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

A helper that enables an input view to temporarily cache values as it is iterated over. More...

#include <seqan3/utility/views/detail/non_propagating_cache.hpp>

+ Inheritance diagram for seqan3::detail::non_propagating_cache< T >:

Public Member Functions

template<class I >
requires requires (I const & i) { T(*i); }
constexpr T & emplace_deref (I const &i)
 Destroys current value, initializes with new value obtained from dereferencing i, and returns value.
 
constexpr non_propagating_cache (non_propagating_cache &&other) noexcept
 Move constructor is a no-op for this and destroys value of other.
 
constexpr non_propagating_cache (non_propagating_cache const &) noexcept
 Copy construction is a no-op.
 
constexpr non_propagating_cacheoperator= (non_propagating_cache &&other) noexcept
 Move assignment destroys values of both this and other.
 
constexpr non_propagating_cacheoperator= (non_propagating_cache const &other) noexcept
 Copy assignment is a no-op if this == other, otherwise destroys value of this.
 
- Public Member Functions inherited from std::optional< T >
emplace (T... args)
 
has_value (T... args)
 
operator bool (T... args)
 
operator* (T... args)
 
operator-> (T... args)
 
operator= (T... args)
 
optional (T... args)
 
reset (T... args)
 
swap (T... args)
 
value (T... args)
 
value_or (T... args)
 
~optional (T... args)
 

Detailed Description

template<typename T>
requires std::is_object_v<T>
class seqan3::detail::non_propagating_cache< T >

A helper that enables an input view to temporarily cache values as it is iterated over.

See also
https://eel.is/c++draft/range.nonprop.cache

Behaves like std::optional, but

  • Constrains its type parameter T with std::is_object_v<T>.
  • Copy constructor is a no-op.
  • Move constructor is a no-op for this and destroys value of other.
  • Copy assignment is a no-op if this == other, otherwise destroys value of this.
  • Move assignment destroys both objects.
  • Has an additional emplace_deref member function.

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