The type returned by seqan3::views::take and seqan3::views::take_or_throw. More...
#include <seqan3/range/views/take.hpp>
Classes | |
class | basic_iterator |
The forward declared iterator type. More... | |
Public Member Functions | |
Constructors, destructor and assignment | |
view_take ()=default | |
Defaulted. | |
view_take (view_take const &rhs)=default | |
Defaulted. | |
view_take (view_take &&rhs)=default | |
Defaulted. | |
view_take & | operator= (view_take const &rhs)=default |
Defaulted. | |
view_take & | operator= (view_take &&rhs)=default |
Defaulted. | |
~view_take ()=default | |
Defaulted. | |
constexpr | view_take (urng_t _urange, size_t const _size) |
Construct from another View. More... | |
template<std::ranges::viewable_range rng_t> | |
constexpr | view_take (rng_t &&_urange, size_t const _size) |
Construct from another viewable_range. More... | |
Iterators | |
constexpr auto | begin () noexcept |
Returns an iterator to the first element of the container. More... | |
constexpr auto | begin () const noexcept requires const _iterable_range< urng_t > |
Returns an iterator to the first element of the container. More... | |
constexpr auto | end () noexcept |
Returns an iterator to the element following the last element of the range. More... | |
constexpr auto | end () const noexcept requires const _iterable_range< urng_t > |
Returns an iterator to the element following the last element of the range. More... | |
Private Types | |
Associated types | |
using | iterator = basic_iterator< urng_t > |
The iterator type of this view (a random access iterator). | |
using | const_iterator = basic_iterator< urng_t const > |
Note that this declaration does not give any compiler errors for non-const iterable ranges. Although basic_iterator inherits from std::ranges::iterator_t which is not defined on a const-range, i.e. `urng_t const, if it is not const-iterable. We only just declare this type and never instantiate it, i.e. use this type within this class, if the underlying range is not const-iterable. | |
Private Attributes | |
size_t | target_size |
The desired target_size. | |
urng_t | urange |
The underlying range. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename urng_t , bool exactly = false, bool or_throw = false> | |
view_take (urng_t &&, size_t) -> view_take< std::views::all_t< urng_t >, exactly, or_throw > | |
Template argument type deduction guide that strips references. | |
The type returned by seqan3::views::take and seqan3::views::take_or_throw.
urng_t | The type of the underlying ranges, must satisfy seqan3::views::concept. |
exactly | Whether to expose sized'ness on the view. |
or_throw | Whether to throw an exception when the input is exhausted before the end of line is reached. |
Note that most members of this class are generated by ranges::view_interface which is not yet documented here.
|
inlineconstexpr |
Construct from another View.
[in] | _urange | The underlying range. |
[in] | _size | The desired size (after which to stop returning elements). |
unexpected_end_of_input | If exactly && or_throw && seqan3::sized_range<urng_t> . |
|
inlineconstexpr |
Construct from another viewable_range.
rng_t | Type of the passed range; urng_t must be constructible from this. |
[in] | _urange | The underlying range. |
[in] | _size | The desired size (after which to stop returning elements). |
unexpected_end_of_input | If exactly && or_throw && seqan3::sized_range<urng_t> . |
|
inlineconstexprnoexcept |
Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element of the range.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element of the range.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
Constant.
No-throw guarantee.