MGIS
Loading...
Searching...
No Matches
mgis::OptionalReference< ValueType > Struct Template Reference

a class that may contain a reference to a class More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Utilities/OptionalReference.hxx>

Public Types

using element_type = ValueType
 
using pointer = ValueType *
 
using reference = ValueType &
 

Public Member Functions

constexpr OptionalReference (std::nullptr_t) noexcept
 
constexpr OptionalReference (pointer p) noexcept
 
template<typename ValueType2 >
requires (std::is_convertible<ValueType2*, ValueType*>::value)
constexpr OptionalReference (OptionalReference< ValueType2 > other) noexcept
 
template<typename ValueType2 >
requires (std::is_convertible<ValueType2*, ValueType*>::value)
constexpr OptionalReference (std::unique_ptr< ValueType2 > const &other) noexcept
 
template<typename ValueType2 >
requires (std::is_convertible<ValueType2*, ValueType*>::value)
constexpr OptionalReference (std::shared_ptr< ValueType2 > const &other) noexcept
 
constexpr pointer get () const noexcept
 
constexpr reference operator* () const
 
constexpr pointer operator-> () const noexcept
 
constexpr operator bool () const noexcept
 
constexpr operator pointer () const noexcept
 
constexpr pointer release () noexcept
 
constexpr void reset (pointer p=nullptr) noexcept
 
constexpr void swap (OptionalReference &other) noexcept
 

Detailed Description

template<typename ValueType>
struct mgis::OptionalReference< ValueType >

a class that may contain a reference to a class

Note
this class was introduced by of the lack of optional references befor to C++-26.
the design of the class is loosely modeled by the std::experimental::observer_ptr proposal

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