vari
|
A non-nullable owning pointer to one of the types in Ts... More...
#include <uvref.h>
Inherits vari::_deleter_box< Deleter >.
Public Member Functions | |
template<typename Deleter2 , typename... Us> requires ( vconvertible_to< typelist< Us... >, types > && convertible_deleter< Deleter2, Deleter > ) | |
constexpr | _uvref (_uvref< Deleter2, Us... > &&p) noexcept |
Constructs an uvref by transfering ownership from uvref with compatible types. | |
template<typename U > requires ( vconvertible_type< U, types > ) | |
constexpr | _uvref (U &u) noexcept |
Constructs an uvref which owns a reference to one of the types that uvref can reference. | |
template<typename U > requires ( vconvertible_type< U, types > && move_constructible_deleter< Deleter > ) | |
constexpr | _uvref (U &u, Deleter &&d) noexcept |
Constructs an uvref which owns a reference to one of the types that uvref can reference. More... | |
template<typename U > requires ( vconvertible_type< U, types > && copy_constructible_deleter< Deleter > ) | |
constexpr | _uvref (U &u, Deleter const &d) noexcept |
Constructs an uvref which owns a reference to one of the types that uvref can reference. More... | |
constexpr reference | get () const noexcept |
Returns a reference to the pointed-to type. | |
Deleter const & | get_deleter () const noexcept |
Getter to the internal deleter. | |
Deleter & | get_deleter () noexcept |
Getter to the internal deleter. | |
constexpr index_type | index () const noexcept |
Returns the index representing the type currently being referenced. More... | |
template<typename... Us> | |
constexpr | operator _vref< Us... > () &&=delete |
Conversion operator from rvalue reference to vref is forbidden. | |
template<typename... Us> requires ( vconvertible_to< types, typelist< Us... > > ) | |
constexpr | operator _vref< Us... > () &noexcept |
Conversion operator from lvalue reference to types-compatible vref | |
template<typename... Us> requires ( vconvertible_to< types, typelist< Us... > > ) | |
constexpr | operator _vref< Us... > () const &noexcept |
Conversion operator from lvalue const reference to types-compatible vref | |
constexpr auto & | operator* () const noexcept |
Dereferences to the pointed-to type. More... | |
constexpr auto * | operator-> () const noexcept |
Provides member access to the pointed-to type. More... | |
template<typename Deleter2 , typename... Us> requires ( vconvertible_to< typelist< Us... >, types > && convertible_deleter< Deleter2, Deleter > ) | |
constexpr _uvref & | operator= (_uvref< Deleter2, Us... > &&p) noexcept |
Move assignment operator transfering ownership from uvref with compatible types. More... | |
template<typename... Fs> | |
constexpr decltype(auto) | take (Fs &&... fs) && |
Constructs an owning reference to currently pointed-to type and transfers ownership to it. More... | |
template<typename... Fs> | |
constexpr decltype(auto) | visit (Fs &&... f) const |
Calls the appropriate function from the list fs... , based on the type of the current target. | |
constexpr owning_pointer | vptr () &&noexcept |
Constructs an owning variadic pointer and transfers ownership of current target to the pointer. | |
constexpr pointer | vptr () const &noexcept |
Constructs a variadic pointer that points to the same target as the current reference. | |
constexpr | ~_uvref () |
Destroys the owned object. | |
Friends | |
constexpr void | swap (_uvref &lh, _uvref &rh) noexcept |
Swaps uvref with each other. | |
A non-nullable owning pointer to one of the types in Ts...
|
inlineexplicitconstexprnoexcept |
Constructs an uvref
which owns a reference to one of the types that uvref
can reference.
Internal Deleter
is copy-constructed from d
.
|
inlineexplicitconstexprnoexcept |
Constructs an uvref
which owns a reference to one of the types that uvref
can reference.
Internal Deleter
is move-constructed from d
.
|
inlineconstexprnoexcept |
Returns the index representing the type currently being referenced.
The index of the first type is 0, with subsequent types sequentially numbered.
|
inlineconstexprnoexcept |
Dereferences to the pointed-to type.
It is T&
if there is only one type in Ts...
, or void&
otherwise.
|
inlineconstexprnoexcept |
Provides member access to the pointed-to type.
It is T*
if there is only one type in Ts...
, or void*
otherwise.
|
inlineconstexprnoexcept |
Move assignment operator transfering ownership from uvref
with compatible types.
Deleter
is move-constructed from the other uvref
.
|
inlineconstexpr |
Constructs an owning reference to currently pointed-to type and transfers ownership to it.
Moves it to the appropriate function from the list fs...
.