Standard library views.
More...
Standard library views.
- Todo:
- write me.
◆ subrange
template<std::Iterator it_t, std::Sentinel< it_t > sen_t>
Create a view from a pair of iterator and sentinel.
- Template Parameters
-
- Parameters
-
[in] | it | The iterator on the underlying range. |
[in] | sen | The sentinel on the underlying range |
- Returns
- A view of the elements between it_t and sen_t.
View properties
This view is source-only, it can only be at the beginning of a pipe of range transformations.
Preservation in this table refers to the properties of the iterator/sentinel pair.
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
dna4_vector s{"ACTTTGATAA"_dna4};
using iterator = dna4_vector::iterator;
◆ all
constexpr auto seqan3::view::all |
|
inline |
A view that safely wraps a container (you will likely not need to use this unless defining a new view).
- Template Parameters
-
urng_t | The type of the range being processed. See below for requirements. |
- Parameters
-
[in] | urange | The range being processed. |
- Returns
- A view over the elements of the underlying range.
View properties
This view is source-only, it can only be at the beginning of a pipe of range transformations. The "underlying range" refers to the mandatory parameter of this adaptor, not a previous range in a pipe.
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
dna4_vector s{"ACTTTGATAN"_dna4};
◆ common
constexpr auto seqan3::view::common |
|
inline |
A range adaptor that makes any range satisfy std::ranges::CommonRange (at the expense of some performance).
- Template Parameters
-
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
- Parameters
-
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
- Returns
- A view of the underlying range that is common – even if the underlying range is not.
View properties
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
dna5_vector s{"ACTNTGATAN"_dna5};
auto v1 = s |
view::filter([](dna5
const l) {
return (l !=
'N'_dna5); });
auto it = std::find(
begin(v2),
end(v2),
'G'_dna5);
◆ filter
constexpr auto seqan3::view::filter |
|
inline |
A range adaptor that takes a predicate and returns a view of the elements that satisfy the predicate.
- Template Parameters
-
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
predicate_t | The type of the predicate, must satisfy seqan3::predicate_concept. |
- Parameters
-
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in,out] | predicate | The predicate. |
- Returns
- A range of those elements in the underlying range that satisfy the predicate.
View properties
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
dna5_vector s{"ACTNTGATAN"_dna5};
auto v1 = s |
view::filter([](dna5
const l) {
return (l !=
'N'_dna5); });
◆ reverse
constexpr auto seqan3::view::reverse |
|
inline |
A range adaptor that presents the underlying range in reverse order.
- Template Parameters
-
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
- Parameters
-
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
- Returns
- A view of the elements of the underlying range in reverse order.
View properties
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
std::string s{"ACTNTGATAN"};
◆ transform
constexpr auto seqan3::view::transform |
|
inline |
A range adaptor that takes a invocable and returns a view of the elements with the invocable applied.
- Template Parameters
-
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
invocable_t | The type of the invocable, must satisfy std::Invocable. |
- Parameters
-
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in,out] | invocable | The invocable (usually a lambda function). |
- Returns
- A range of the elements produced by applied the invocable to each element in the underlying range.
View properties
See the view submodule documentation for detailed descriptions of the view properties.
STD module
This entity will likely be part of C++20 or C++23. It's API will track current proposals and not be stable within SeqAn3 releases. It is implemented via the range-v3 library or the standard library (if available). Should it become clear that it will not become part of a future standard, it will migrate to a regular SeqAn3 module.
Example
std::string s{"ACTNTGATAN"};