Skip to content

Commit

Permalink
[MISC] Deprecate views::take_until
Browse files Browse the repository at this point in the history
- `seqan3::views::take_until` is moved to `seqan3/io/detail` for
  internal use only. As an alternative please use
  `std::views::take_while` in combination with `std::not_fn`.
- moved snippets and test accordingly.
- add CHANGLELOG entry
  • Loading branch information
SGSSGene committed May 10, 2021
1 parent 52f0b79 commit b8baaae
Show file tree
Hide file tree
Showing 27 changed files with 782 additions and 723 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ regression test suite and patches at https://github.com/seqan/seqan3/tree/master
[\#2541](https://github.com/seqan/seqan3/pull/2541).
* We deprecated `seqan3::views::take_line` and it will be removed in 3.1.0
[\#2525](https://github.com/seqan/seqan3/pull/2525).
* We deprecated `seqan3::views::take_until` and it will be removed in 3.1.0. Use `std::views::take_while` in
combination with `std::not_fn` ([\#2604](https://github.com/seqan/seqan3/pull/2604)).
* We deprecated `seqan3::views::to_upper` and it will be removed in 3.1.0, use
`std::views::transform([](auto && chr){return std::toupper(chr)})`.
([\#2540](https://github.com/seqan/seqan3/pull/2538))
Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/alphabet/views/trim_quality.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <seqan3/std/ranges>

#include <seqan3/alphabet/quality/qualified.hpp>
#include <seqan3/range/views/take_until.hpp>
#include <seqan3/io/detail/take_until_view.hpp>
#include <seqan3/utility/views/deep.hpp>

namespace seqan3::detail
Expand Down Expand Up @@ -55,7 +55,7 @@ struct trim_fn
"The threshold must either be a letter of the underlying alphabet or an integral type "
"in which case it is compared with the underlying Phred score type.");

return views::take_until(std::forward<irng_t>(irange), [threshold] (auto const value)
return detail::take_until(std::forward<irng_t>(irange), [threshold] (auto const value)
{
if constexpr (std::same_as<std::remove_cvref_t<threshold_t>,
std::remove_cvref_t<std::ranges::range_reference_t<irng_t>>>)
Expand Down
6 changes: 3 additions & 3 deletions include/seqan3/io/detail/take_line_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#pragma once

#include <seqan3/range/views/take_until.hpp>
#include <seqan3/io/detail/take_until_view.hpp>
#include <seqan3/utility/char_operations/predicate.hpp>

// ============================================================================
Expand Down Expand Up @@ -75,7 +75,7 @@ namespace seqan3::detail
* On single pass std::ranges::input_range it can be used to tokenise the input stream line-wise:
* \include test/snippet/io/detail/take_line_view_tokenise.cpp
*/
inline auto constexpr take_line = views::take_until_and_consume(is_char<'\r'> || is_char<'\n'>);
inline auto constexpr take_line = detail::take_until_and_consume(is_char<'\r'> || is_char<'\n'>);

// ============================================================================
// detail::take_line_or_throw (adaptor instance definition)
Expand All @@ -87,7 +87,7 @@ inline auto constexpr take_line = views::take_until_and_consume(is_char<'\r'> ||
*
* \copydetails seqan3::detail::take_line
*/
inline auto constexpr take_line_or_throw = views::take_until_or_throw_and_consume(is_char<'\r'> || is_char<'\n'>);
inline auto constexpr take_line_or_throw = detail::take_until_or_throw_and_consume(is_char<'\r'> || is_char<'\n'>);

//!\}

Expand Down
Loading

0 comments on commit b8baaae

Please sign in to comment.