Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
persistent_reference< T > Struct Template Reference

Persistent reference (no difference for non const references) More...

#include <reference.h>

Inherits reference< T >, and reference_impl< T, bbm::pointer< T > >.

Public Types

using base_type = bbm::detail::reference_impl< T, bbm::pointer< T > >
 
- Public Types inherited from reference< T >
using base_type = bbm::detail::reference_impl< T, std::add_pointer_t< std::remove_reference_t< T > > >
 

Public Member Functions

template<typename R >
requires (!std::is_same_v<persistent_reference<T>, std::decay_t<R>>) && ((std::is_rvalue_reference_v<R&&> && std::same_as<std::remove_cvref_t<R>, std::remove_cvref_t<T>>) || (std::constructible_from<std::remove_reference_t<T>, R> && !std::same_as<std::remove_cvref_t<R>, std::remove_cvref_t<T>>))
constexpr persistent_reference (R &&val) noexcept
 Handle assignment to a const reference of a temporary variable => make_pointer This occurs if: 1) R != persistent_reference<T> (use copy constructor in this case) 2) if R == rvalue itself and R==T else if an implicit conversion results in an rvalue (i.e., R is implicitely convertible to T and R!=T). This explicitely avoids (non-rvalue) T.
 
- Public Member Functions inherited from reference< T >
constexpr reference (std::decay_t< T > &&)=delete
 Disallow rvalue construction.
 

Detailed Description

template<typename T>
requires (!bbm::is_const_v<T>)
struct bbm::persistent_reference< T >

Persistent reference (no difference for non const references)

Persistent reference (extend lifetime of const rvalue references)

Member Typedef Documentation

◆ base_type

using base_type = bbm::detail::reference_impl<T, bbm::pointer<T> >

Constructor & Destructor Documentation

◆ persistent_reference()

constexpr persistent_reference ( R &&  val)
inlineconstexprnoexcept

Handle assignment to a const reference of a temporary variable => make_pointer This occurs if: 1) R != persistent_reference<T> (use copy constructor in this case) 2) if R == rvalue itself and R==T else if an implicit conversion results in an rvalue (i.e., R is implicitely convertible to T and R!=T). This explicitely avoids (non-rvalue) T.


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