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

The type returned by seqan3::views::repeat. More...

#include <seqan3/utility/views/repeat.hpp>

+ Inheritance diagram for seqan3::detail::repeat_view< value_t >:

Classes

class  basic_iterator
 The forward declared iterator type for views::repeat (a random access iterator). More...
 

Public Member Functions

Constructors, destructor and assignment
 repeat_view ()=default
 Defaulted.
 
 repeat_view (repeat_view const &)=default
 Defaulted.
 
repeat_viewoperator= (repeat_view const &)=default
 Defaulted.
 
 repeat_view (repeat_view &&)=default
 Defaulted.
 
repeat_viewoperator= (repeat_view &&)=default
 Defaulted.
 
 ~repeat_view ()=default
 Defaulted.
 
constexpr repeat_view (value_t const &value)
 Construct from any type (Note: the value will be copied into views::single).
 
constexpr repeat_view (value_t &&value)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Iterators
constexpr iterator begin () noexcept
 Returns an iterator to the first element of the range.
 
constexpr const_iterator begin () const noexcept
 Returns an iterator to the first element of the range.
 
constexpr sentinel_type end () noexcept
 Returns an iterator to the element following the last element of the range.
 
constexpr sentinel_type end () const noexcept
 Returns an iterator to the element following the last element of the range.
 

Private Types

using base_t = std::ranges::view_interface< repeat_view< value_t > >
 /brief the base type.
 
using sentinel_type = std::default_sentinel_t
 The sentinel type is set to std::default_sentinel_t.
 
using single_value_t = decltype(std::views::single(std::declval< value_t >()))
 The view which wraps the single value to repeat.
 
Associated types
using value_type = std::remove_reference_t< value_t >
 The value type (equals the value_t with any references removed).
 
using reference = value_type &
 The reference_type.
 
using const_reference = value_type const &
 The const reference type.
 
using difference_type = ptrdiff_t
 The type to store the difference of two iterators.
 
using iterator = basic_iterator< repeat_view >
 The iterator type of this view (a random access iterator).
 
using const_iterator = basic_iterator< repeat_view const >
 The const_iterator type is equal to the iterator type but over the const qualified type.
 

Friends

template<typename range_type , template< typename... > typename derived_t_template, typename... args_t>
class detail::random_access_iterator_base
 Befriend the following class s.t. iterator and const_iterator can be defined for this type.
 

Element access

single_value_t single_value
 }
 
constexpr const_reference operator[] (difference_type const n) const noexcept
 Returns the n-th element.
 
constexpr reference operator[] (difference_type const n) noexcept
 Returns the n-th element.
 

Detailed Description

template<std::copy_constructible value_t>
class seqan3::detail::repeat_view< value_t >

The type returned by seqan3::views::repeat.

Template Parameters
value_tThe type of value to repeat which is always wrapped in a std::views::single.

This class models an infinite range over a given value, although "infinity" is limited by the maximum value of difference_type of which the iterator stores a member variable to represent distances.

Note that most members of this class are generated by std::ranges::view_interface which is not yet documented here.

Member Function Documentation

◆ begin() [1/2]

template<std::copy_constructible value_t>
constexpr const_iterator seqan3::detail::repeat_view< value_t >::begin ( ) const
inlineconstexprnoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

This range is never empty so the returned iterator will never be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ begin() [2/2]

template<std::copy_constructible value_t>
constexpr iterator seqan3::detail::repeat_view< value_t >::begin ( )
inlineconstexprnoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

This range is never empty so the returned iterator will never be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [1/2]

template<std::copy_constructible value_t>
constexpr sentinel_type seqan3::detail::repeat_view< value_t >::end ( ) const
inlineconstexprnoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [2/2]

template<std::copy_constructible value_t>
constexpr sentinel_type seqan3::detail::repeat_view< value_t >::end ( )
inlineconstexprnoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ operator[]() [1/2]

template<std::copy_constructible value_t>
constexpr const_reference seqan3::detail::repeat_view< value_t >::operator[] ( difference_type const  n) const
inlineconstexprnoexcept

Returns the n-th element.

Parameters
nThe position of the element to return.
Returns
A reference to the cached value.

Since this range is an infinite range, access is never out-of-bounds.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ operator[]() [2/2]

template<std::copy_constructible value_t>
constexpr reference seqan3::detail::repeat_view< value_t >::operator[] ( difference_type const  n)
inlineconstexprnoexcept

Returns the n-th element.

Parameters
nThe position of the element to return.
Returns
A reference to the cached value.

Since this range is an infinite range, access is never out-of-bounds.

Complexity

Constant.

Exceptions

No-throw guarantee.

Member Data Documentation

◆ single_value

template<std::copy_constructible value_t>
single_value_t seqan3::detail::repeat_view< value_t >::single_value
private

}

A std::views::single over the input.


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