vari
Loading...
Searching...
No Matches
vari::_vref< Ts > Class Template Reference

A non-nullable pointer to one of the types in Ts... More...

#include <vref.h>

Public Member Functions

template<typename... Us>
requires ( vconvertible_to< typelist< Us... >, types > )
constexpr _vref (_vref< Us... > const &p) noexcept
 Copy constructor for any compatible vref.
 
template<typename U >
requires ( vconvertible_to< typelist< U >, types > )
constexpr _vref (U &u) noexcept
 Constructs a vref from a reference to one of the types that vref can reference.
 
constexpr auto * get () const noexcept
 Returns a pointer to the pointed-to type. More...
 
constexpr index_type index () const noexcept
 Returns the index representing the type currently being referenced. More...
 
template<typename U >
requires ( vconvertible_to< types, typelist< U > > )
constexpr operator U& () const noexcept
 If the reference can only point to one type, it allows conversion to a reference of that type.
 
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... Fs>
constexpr decltype(auto) visit (Fs &&... fs) const
 Calls the appropriate function from the list fs..., based on the type of the current target.
 
constexpr pointer vptr () const &noexcept
 Constructs a variadic pointer that points to the same target as the current reference.
 

Friends

constexpr void swap (_vref &lh, _vref &rh) noexcept
 Swaps the current reference with another one.
 

Detailed Description

template<typename... Ts>
class vari::_vref< Ts >

A non-nullable pointer to one of the types in Ts...

Member Function Documentation

◆ get()

template<typename... Ts>
constexpr auto * vari::_vref< Ts >::get ( ) const
inlineconstexprnoexcept

Returns a pointer to the pointed-to type.

It is T* if there is only one type in Ts..., or void* otherwise.

◆ index()

template<typename... Ts>
constexpr index_type vari::_vref< Ts >::index ( ) const
inlineconstexprnoexcept

Returns the index representing the type currently being referenced.

The index of the first type is 0, with subsequent types sequentially numbered.

◆ operator*()

template<typename... Ts>
constexpr auto & vari::_vref< Ts >::operator* ( ) const
inlineconstexprnoexcept

Dereferences to the pointed-to type.

It is T& if there is only one type in Ts..., or void& otherwise.

◆ operator->()

template<typename... Ts>
constexpr auto * vari::_vref< Ts >::operator-> ( ) const
inlineconstexprnoexcept

Provides member access to the pointed-to type.

It is T* if there is only one type in Ts..., or void* otherwise.


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