Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate seqan3::views::take_until #332

Closed
3 tasks
marehr opened this issue Apr 18, 2021 · 1 comment
Closed
3 tasks

deprecate seqan3::views::take_until #332

marehr opened this issue Apr 18, 2021 · 1 comment
Assignees

Comments

@marehr
Copy link
Member

marehr commented Apr 18, 2021

Tasks

  • deprecate seqan3::views::take_until
  • remove usage from our tests/snippets
  • add changelog entry
From 9349d35c51d6c4b8bb92426ba33643d3702d0347 Mon Sep 17 00:00:00 2001
From: marehr <marehr-github@marehr.dialup.fu-berlin.de>
Date: Sun, 18 Apr 2021 12:47:50 +0200
Subject: [PATCH 10/35] TODO: [MISC] deprecate seqan3::views::take_until

---
 include/seqan3/range/views/take_until.hpp | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/include/seqan3/range/views/take_until.hpp b/include/seqan3/range/views/take_until.hpp
index 63cd33109..74300ef94 100644
--- a/include/seqan3/range/views/take_until.hpp
+++ b/include/seqan3/range/views/take_until.hpp
@@ -587,7 +587,7 @@ namespace seqan3::views
  *
  * Consuming: `seqan3::views::take_until_and_consume` and `seqan3::views::take_until_or_throw_and_consume` behave the same
  * as their non-consuming counter-parts if the underlying range models at least `std::forward_range`.
- * If, however, the underlying range is a pure `std::input_range`, the view will keep moving the underlying
+ * If, however, the underlying range is a pure `std::views::input_range`, the view will keep moving the underlying
  * iterator forward as long as the termination criterium holds and the underlying range is not at end.
  * This is useful for string tokenisation among other things.
  *
@@ -596,6 +596,9 @@ namespace seqan3::views
  * \include test/snippet/range/views/take_until.cpp
  *
  * \hideinitializer
+ *
+ * \deprecated TODO find out if std::views::take_while(!pred) is the same as seqan3::views::take_until(pred)
+ *             TODO move to include/seqan3/io/detail/take_until.hpp
  */
 inline auto constexpr take_until = detail::take_until_fn<false, false>{};
 
@@ -610,6 +613,14 @@ inline auto constexpr take_until = detail::take_until_fn<false, false>{};
  *
  * \copydetails seqan3::views::take_until
  * \hideinitializer
+ * \deprecated TODO move to include/seqan3/io/detail/take_until.hpp
+ *             auto take_while = std::views::take_while(v, !pred); A C G T \0
+ *             // do whatever take_while does, e.g. seqan3::detail::consume(take_while);
+ *             auto it = std::ranges::next(std::ranges::begin(take_while), std::ranges::end(take_while));
+ *
+ *             // following ONLY WORKS for input_ranges
+ *             if (it == std::ranged::end(v))
+ *                 throw reached_end;
  */
 inline auto constexpr take_until_or_throw = detail::take_until_fn<true, false>{};
 
@@ -624,6 +635,12 @@ inline auto constexpr take_until_or_throw = detail::take_until_fn<true, false>{}
  *
  * \copydetails seqan3::views::take_until
  * \hideinitializer
+ * \deprecated TODO move to include/seqan3/io/detail/take_until.hpp
+ *             TODO alternative
+ *             seems to be the same as std::views::take_while(!pred) after that std::views::drop_while(pred);
+ *             v1 = take_while(v, !pred);
+ *             // processes v1 and after that
+ *             v2 = drop_while(v, pred) | another_view
  */
 inline auto constexpr take_until_and_consume = detail::take_until_fn<false, true>{};
 
@@ -638,6 +655,9 @@ inline auto constexpr take_until_and_consume = detail::take_until_fn<false, true
  *
  * \copydetails seqan3::views::take_until
  * \hideinitializer
+ * \deprecated TODO move to include/seqan3/io/detail/take_until.hpp
+ *             TODO alternative
+ *             seems to be the same as std::views::take_while(!pred) after that std::views::drop_while(pred);
  */
 inline auto constexpr take_until_or_throw_and_consume = detail::take_until_fn<true, true>{};
 
-- 
2.31.1
@marehr
Copy link
Member Author

marehr commented May 11, 2021

fixed by seqan/seqan3#2604

@marehr marehr closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants