MGIS 3.1.0
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) MGIS_NOEXCEPT
constexpr OptionalReference (pointer p) MGIS_NOEXCEPT
template<typename ValueType2>
requires (std::is_convertible_v<ValueType2*, ValueType*>)
constexpr OptionalReference (OptionalReference< ValueType2 > other) MGIS_NOEXCEPT
template<typename ValueType2>
requires (std::is_convertible_v<ValueType2*, ValueType*>)
constexpr OptionalReference (std::unique_ptr< ValueType2 > const &other) MGIS_NOEXCEPT
template<typename ValueType2>
requires (std::is_convertible_v<ValueType2*, ValueType*>)
constexpr OptionalReference (std::shared_ptr< ValueType2 > const &other) MGIS_NOEXCEPT
constexpr pointer get () const MGIS_NOEXCEPT
constexpr reference operator* () const
constexpr pointer operator-> () const MGIS_NOEXCEPT
constexpr bool has_value () const MGIS_NOEXCEPT
constexpr operator bool () const MGIS_NOEXCEPT
constexpr operator pointer () const MGIS_NOEXCEPT
constexpr pointer release () MGIS_NOEXCEPT
constexpr void reset (pointer p=nullptr) MGIS_NOEXCEPT
constexpr void swap (OptionalReference &other) MGIS_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 prior 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: