mrdocs::Optional<T&>

Optional reference wrapper that never owns storage.

Synopsis

Declared in <mrdocs/ADT/Optional.hpp>

template<class T>
class Optional<T&>;

Types

Name

Description

value_type

Referenced value type.

Member Functions

Name

Description

Optional [constructor]

Constructors

operator=

Assignment operators

emplace

Bind to a new referenced value.

has_value

Check whether the optional holds a reference.

operator*

Dereference the referenced object.

operator‐>

Return pointer to the referenced object.

reset

Disengage the optional.

swap

Exchange the contained value with another Optional.

value

value overloads

operator bool

Return true when the optional holds a reference.

Static Member Functions

Name

Description

is_inlined

Return true because Optional<T&> never allocates storage.

Description

Stores a pointer to an externally owned object; the disengaged state is nullptr.

Created with MrDocs