SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::maybe_iterator_category< underlying_iterator_t > Struct Template Reference

Defines iterator_category member if underlying_iterator_t has a valid std::iterator_traits::iterator_category overload. More...

#include <seqan3/core/detail/iterator_traits.hpp>

+ Inheritance diagram for seqan3::detail::maybe_iterator_category< underlying_iterator_t >:

Public Types

using iterator_category = MAYBE_PRESENT(std::iterator_traits< underlying_iterator_t >::iterator_category)
 The iterator category tag. (not always present!)
 

Detailed Description

template<typename underlying_iterator_t>
struct seqan3::detail::maybe_iterator_category< underlying_iterator_t >

Defines iterator_category member if underlying_iterator_t has a valid std::iterator_traits::iterator_category overload.

The C++ paper P2259R1 defines the behaviour of iterator_category for a C++-20 input iterator.

https://wg21.link/p2259r1#fixing-counted_iterator states:

‍Provide member iterator_concept and iterator_category when the wrapped iterator type provides them, to honor its opt-in/opt-outs.

That means, only define iterator_category if the underlying iterator has it.

See also
https://github.com/seqan/product_backlog/issues/151
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96070

Member Typedef Documentation

◆ iterator_category

template<typename underlying_iterator_t >
using seqan3::detail::maybe_iterator_category< underlying_iterator_t >::iterator_category = MAYBE_PRESENT(std::iterator_traits<underlying_iterator_t>::iterator_category)

The iterator category tag. (not always present!)

This member is only defined if and only if std::iterator_traits<underlying_iterator_t>::iterator_category is valid and denotes a type.


The documentation for this struct was generated from the following file:
Hide me