VCCC  2024.05
VisualCamp Common C++ library
view_interface< Derived > Class Template Reference

#include </home/jarvis/actions-runner/jarvis-vccc-2/_work/vccc/vccc/include/vccc/__ranges/view_interface.hpp>

+ Inheritance diagram for view_interface< Derived >:

Detailed Description

template<typename Derived>
class vccc::ranges::view_interface< Derived >

vccc::ranges::view_interface is a helper class template for defining a view interface.

view_interface is typically used with CRTP:

See also
std::ranges::view_interface

Public Types

using $vccc_derived = Derived
 

Public Member Functions

empty

returns whether the derived view is empty. Provided if it satisfies sized_range or forward_range.

template<typename D = Derived, std::enable_if_t< sized_range< D >::value, int > = 0>
constexpr bool empty ()
 
template<typename D = Derived, std::enable_if_t< conjunction< negation< sized_range< D >>, forward_range< D > >::value, int > = 0>
constexpr bool empty ()
 
template<typename D = Derived, std::enable_if_t< sized_range< const D >::value, int > = 0>
constexpr bool empty () const
 
template<typename D = Derived, std::enable_if_t< conjunction< negation< sized_range< const D >>, forward_range< const D > >::value, int > = 0>
constexpr bool empty () const
 
cbegin

returns a constant iterator to the beginning of the range.

constexpr auto cbegin ()
 
template<typename D = Derived, std::enable_if_t< range< const D >::value, int > = 0>
constexpr auto cbegin () const
 
cend

returns a sentinel for the constant iterator of the range.

constexpr auto cend ()
 
template<typename D = Derived, std::enable_if_t< range< const D >::value, int > = 0>
constexpr auto cend () const
 
operator bool

returns whether the derived view is not empty. Provided if ranges::empty is applicable to it.

template<typename D = Derived, std::enable_if_t< detail::is_empty_callable< D & >::value, int > = 0>
constexpr operator bool ()
 
template<typename D = Derived, std::enable_if_t< detail::is_empty_callable< const D & >::value, int > = 0>
constexpr operator bool () const
 
data

gets the address of derived view's data. Provided if its iterator type satisfies contiguous_iterator.

template<typename D = Derived, std::enable_if_t< detail::check_vi_data< D >::value, int > = 0>
constexpr auto data ()
 
template<typename D = Derived, std::enable_if_t< detail::check_vi_data< const D >::value, int > = 0>
constexpr auto data () const
 
size

returns the number of elements in the derived view. Provided if it satisfies forward_range and its sentinel and iterator type satisfy sized_sentinel_for.

template<typename D = Derived, std::enable_if_t< detail::check_vi_size< D >::value, int > = 0>
constexpr auto size ()
 
template<typename D = Derived, std::enable_if_t< detail::check_vi_size< const D >::value, int > = 0>
constexpr auto size () const
 
front

returns the number of elements in the derived view. Provided if it satisfies forward_range and its sentinel and iterator type satisfy sized_sentinel_for.

template<typename D = Derived, std::enable_if_t< forward_range< D >::value, int > = 0>
constexpr decltype(auto) front ()
 
template<typename D = Derived, std::enable_if_t< forward_range< const D >::value, int > = 0>
constexpr decltype(auto) front () const
 
back

returns the last element in the derived view. Provided if it satisfies bidirectional_range and common_range.

The default implementation of back() member function returns the last element in the view of the derived type. Whether the element is returned by value or by reference depends on the operator* of the iterator type.

template<typename D = Derived, std::enable_if_t< conjunction< bidirectional_range< D >, common_range< D > >::value, int > = 0>
constexpr decltype(auto) back ()
 
template<typename D = Derived, std::enable_if_t< conjunction< bidirectional_range< const D >, common_range< const D > >::value, int > = 0>
constexpr decltype(auto) back () const
 
operator[]

returns the \( { N^{th}} \) element in the derived view. Provided if it satisfies random_access_range.

The default implementation of operator[] member function obtains the element at the specified offset relative to the beginning iterator, reusing the operator[] of the iterator type.

template<typename R = Derived, std::enable_if_t< random_access_range< R >::value, int > = 0>
constexpr decltype(auto) operator[] (range_difference_t< R > n)
 
template<typename R = const Derived, std::enable_if_t< random_access_range< R >::value, int > = 0>
constexpr decltype(auto) operator[] (range_difference_t< R > n) const
 

Member Typedef Documentation

◆ $vccc_derived

using $vccc_derived = Derived

Member Function Documentation

◆ back() [1/2]

constexpr decltype(auto) back ( )
inlineconstexpr

◆ back() [2/2]

constexpr decltype(auto) back ( ) const
inlineconstexpr

◆ cbegin() [1/2]

constexpr auto cbegin ( )
inlineconstexpr

◆ cbegin() [2/2]

constexpr auto cbegin ( ) const
inlineconstexpr

◆ cend() [1/2]

constexpr auto cend ( )
inlineconstexpr

◆ cend() [2/2]

constexpr auto cend ( ) const
inlineconstexpr

◆ data() [1/2]

constexpr auto data ( )
inlineconstexpr

◆ data() [2/2]

constexpr auto data ( ) const
inlineconstexpr

◆ empty() [1/4]

constexpr bool empty ( )
inlineconstexpr

◆ empty() [2/4]

constexpr bool empty ( )
inlineconstexpr

◆ empty() [3/4]

constexpr bool empty ( ) const
inlineconstexpr

◆ empty() [4/4]

constexpr bool empty ( ) const
inlineconstexpr

◆ front() [1/2]

constexpr decltype(auto) front ( )
inlineconstexpr

◆ front() [2/2]

constexpr decltype(auto) front ( ) const
inlineconstexpr

◆ operator bool() [1/2]

constexpr operator bool ( )
inlineexplicitconstexpr

◆ operator bool() [2/2]

constexpr operator bool ( ) const
inlineexplicitconstexpr

◆ operator[]() [1/2]

constexpr decltype(auto) operator[] ( range_difference_t< R >  n)
inlineconstexpr

◆ operator[]() [2/2]

constexpr decltype(auto) operator[] ( range_difference_t< R >  n) const
inlineconstexpr

◆ size() [1/2]

constexpr auto size ( )
inlineconstexpr

◆ size() [2/2]

constexpr auto size ( ) const
inlineconstexpr

The documentation for this class was generated from the following files: