= Reference
:mrdocs:

== Namespaces

[cols=1]
|===
| Name
| link:#beman[`beman`] 
|===

== link:#beman[beman] namespace

=== Namespaces

[cols=1]
|===
| Name
| link:#beman-optional[`optional`] 
|===

== link:#beman-optional[beman::optional] namespace

=== Types

[cols=2]
|===
| Name
| Description
| link:#beman-optional-bad_optional_access[`bad&lowbar;optional&lowbar;access`] 
| Exception thrown when trying to access the value of an empty optional
| link:#beman-optional-hash-056[`hash`] 
| 
| link:#beman-optional-hash-051[`hash&lt;optional&lt;T&gt;&gt;`] 
| 
| link:#beman-optional-in_place_t[`in&lowbar;place&lowbar;t`] 
| Tag type for in place construction
| link:#beman-optional-nullopt_t[`nullopt&lowbar;t`] 
| Tag type for nullopt construction
| link:#beman-optional-optional-03[`optional`] 
| 
| link:#beman-optional-optional-06[`optional&lt;T&&gt;`] 
| 
|===

=== Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-make_optional-02[`make&lowbar;optional`] 
| 
| link:#beman-optional-swap[`swap`] 
| 
| link:#beman-optional-operator_eq-0b0[`operator&equals;&equals;`] 
| Equality operators
| link:#beman-optional-operator_not_eq-0c[`operator!&equals;`] 
| Inequality operators
| link:#beman-optional-operator_lt-07[`operator&lt;`] 
| Less&hyphen;than operators
| link:#beman-optional-operator_le-05[`operator&lt;&equals;`] 
| Less&hyphen;than&hyphen;or&hyphen;equal operators
| link:#beman-optional-operator_gt-05[`operator&gt;`] 
| Greater&hyphen;than operators
| link:#beman-optional-operator_ge-09[`operator&gt;&equals;`] 
| Greater&hyphen;than&hyphen;or&hyphen;equal operators
| link:#beman-optional-operator_3way-0b[`operator&lt;&equals;&gt;`] 
| Three&hyphen;way comparison operators
|===

=== Variables

[cols=2]
|===
| Name
| Description
| link:#beman-optional-in_place[`in&lowbar;place`] 
| 
| link:#beman-optional-nullopt[`nullopt`] 
| Tag to disengage optional objects&period;
|===

=== Concepts

[cols=1]
|===
| Name
| link:#beman-optional-is_derived_from_optional[`is&lowbar;derived&lowbar;from&lowbar;optional`] 
|===

== Namespaces

[cols=1]
|===
| Name
| link:#beman-optional[`optional`] 
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#beman-optional-bad_optional_access[`bad&lowbar;optional&lowbar;access`] 
| Exception thrown when trying to access the value of an empty optional
| link:#beman-optional-hash-056[`hash`] 
| 
| link:#beman-optional-hash-051[`hash&lt;optional&lt;T&gt;&gt;`] 
| 
| link:#beman-optional-in_place_t[`in&lowbar;place&lowbar;t`] 
| Tag type for in place construction
| link:#beman-optional-nullopt_t[`nullopt&lowbar;t`] 
| Tag type for nullopt construction
| link:#beman-optional-optional-03[`optional`] 
| 
| link:#beman-optional-optional-06[`optional&lt;T&&gt;`] 
| 
|===

== Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-make_optional-02[`make&lowbar;optional`] 
| 
| link:#beman-optional-swap[`swap`] 
| 
| link:#beman-optional-operator_eq-0b0[`operator&equals;&equals;`] 
| Equality operators
| link:#beman-optional-operator_not_eq-0c[`operator!&equals;`] 
| Inequality operators
| link:#beman-optional-operator_lt-07[`operator&lt;`] 
| Less&hyphen;than operators
| link:#beman-optional-operator_le-05[`operator&lt;&equals;`] 
| Less&hyphen;than&hyphen;or&hyphen;equal operators
| link:#beman-optional-operator_gt-05[`operator&gt;`] 
| Greater&hyphen;than operators
| link:#beman-optional-operator_ge-09[`operator&gt;&equals;`] 
| Greater&hyphen;than&hyphen;or&hyphen;equal operators
| link:#beman-optional-operator_3way-0b[`operator&lt;&equals;&gt;`] 
| Three&hyphen;way comparison operators
|===

== Variables

[cols=2]
|===
| Name
| Description
| link:#beman-optional-in_place[`in&lowbar;place`] 
| 
| link:#beman-optional-nullopt[`nullopt`] 
| Tag to disengage optional objects&period;
|===

== Concepts

[cols=1]
|===
| Name
| link:#beman-optional-is_derived_from_optional[`is&lowbar;derived&lowbar;from&lowbar;optional`] 
|===

Exception thrown when trying to access the value of an empty optional

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class bad&lowbar;optional&lowbar;access
    : public std::exception
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `std::exception`
| 
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-bad_optional_access-2constructor[`bad&lowbar;optional&lowbar;access`]         [.small]#[constructor]#
| Construct a new bad optional access object
| link:#beman-optional-bad_optional_access-operator_assign[`operator&equals;`] 
| 
| link:#beman-optional-bad_optional_access-what[`what`]  [.small]#[virtual]#
| Get the error message for bad optional access
|===

Construct a new bad optional access object

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bad&lowbar;optional&lowbar;access() = default;
----

== Synopsis

Declared in `&lt;&lowbar;&lowbar;exception&sol;exception&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;&lowbar;&lowbar;visibility&lowbar;&lowbar;, &lowbar;&lowbar;exclude&lowbar;from&lowbar;explicit&lowbar;instantiation&lowbar;&lowbar;, &lowbar;&lowbar;abi&lowbar;tag&lowbar;&lowbar;&rsqb;&rsqb;
constexpr
exception&
operator&equals;(exception const& value) noexcept = default;
----

Get the error message for bad optional access

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
char const*
what() const noexcept;
----

== Return Value

const char&ast;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
struct hash;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
struct link:#beman-optional-hash-056[hash]&lt;link:#beman-optional-optional-03[optional&lt;T&gt;]&gt;;
----

Tag type for in place construction

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct in&lowbar;place&lowbar;t;
----

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-in_place_t-2constructor[`in&lowbar;place&lowbar;t`]         [.small]#[constructor]#
| Default constructor
|===

Default constructor

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
in&lowbar;place&lowbar;t() = default;
----

Tag type for nullopt construction

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct nullopt&lowbar;t;
----

== Enums

[cols=2]
|===
| Name
| Description
| link:#beman-optional-nullopt_t-Tag[`Tag`] 
| Tag type for nullopt&lowbar;t construction
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-nullopt_t-2constructor[`nullopt&lowbar;t`]         [.small]#[constructor]#
| Construct a new nullopt&lowbar;t object
|===

Tag type for nullopt&lowbar;t construction

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class Tag : int;
----

== Members


[cols=2]
|===
| Name
| Description
|`tag`
|
|===

Construct a new nullopt&lowbar;t object

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
nullopt&lowbar;t(link:#beman-optional-nullopt_t-Tag[Tag] value) noexcept;
----

== Description

constexpr for nullopt&lowbar;t to be literal&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class optional;
----

== Types

[cols=2]
|===
| Name
| Description
| link:#beman-optional-optional-03-const_iterator[`const&lowbar;iterator`] 
| Type alias for the const iterator type of the optional&period;
| link:#beman-optional-optional-03-iterator[`iterator`] 
| Type alias for the iterator type of the optional&period;
| link:#beman-optional-optional-03-value_type[`value&lowbar;type`] 
| Type alias for the value type stored in the optional&period;
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-optional-03-2constructor-026[`optional`]         [.small]#[constructor]#
| Constructors
| link:#beman-optional-optional-03-2destructor-01[`&#126;optional`] [.small]#[destructor]#
| Destructors
| link:#beman-optional-optional-03-operator_assign-01[`operator&equals;`] 
| Assignment operators
| link:#beman-optional-optional-03-and_then-02[`and&lowbar;then`] 
| Returns an optional containing the result of applying `f` to the stored value&period;
| link:#beman-optional-optional-03-begin-09[`begin`] 
| `begin` overloads
| link:#beman-optional-optional-03-emplace-07[`emplace`] 
| `emplace` overloads
| link:#beman-optional-optional-03-end-01[`end`] 
| `end` overloads
| link:#beman-optional-optional-03-has_value[`has&lowbar;value`] 
| Returns whether or not the optional has a value&period;
| link:#beman-optional-optional-03-operator_star-03[`operator&ast;`] 
| Returns a reference to the stored value&period;
| link:#beman-optional-optional-03-operator_ptr-094[`operator&hyphen;&gt;`] 
| Returns a pointer to the stored value&period;
| link:#beman-optional-optional-03-or_else-01[`or&lowbar;else`] 
| Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;
| link:#beman-optional-optional-03-reset[`reset`] 
| Resets the optional to an empty state, destroying the stored value if there is one&period;
| link:#beman-optional-optional-03-swap[`swap`] 
| Swaps this optional with the other&period;
| link:#beman-optional-optional-03-transform-08[`transform`] 
| Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;
| link:#beman-optional-optional-03-value-028[`value`] 
| Returns a reference to the stored value&period;
| link:#beman-optional-optional-03-value_or-03[`value&lowbar;or`] 
| Returns a reference to the stored value&period;
| link:#beman-optional-optional-03-2conversion[`operator bool`] 
| Converts the optional to a boolean indicating whether it has a value&period;
|===

== Data Members

[cols=2]
|===
| Name
| Description
| link:#beman-optional-optional-03-_[`&lowbar;`] [.small]#[variant member]#
| The empty state of the optional&period;
| link:#beman-optional-optional-03-value_[`value&lowbar;`] [.small]#[variant member]#
| The stored value of the optional&period;
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#beman-optional-optional-03[beman::optional::optional]`
| 
|===

== Template Parameters

[cols=2]
|===
| Name
| Description
| *T*
| 
|===

Type alias for the const iterator type of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = &sol;&ast; implementation-defined &ast;&sol;::contiguous&lowbar;iterator&lt;T const, optional&gt;;
----

== Description

Since P3168R2&colon; Give std&colon;&colon;optional Range Support&period;

Type alias for the iterator type of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using iterator = &sol;&ast; implementation-defined &ast;&sol;::contiguous&lowbar;iterator&lt;T, optional&gt;;
----

== Description

Since P3168R2&colon; Give std&colon;&colon;optional Range Support&period;

Type alias for the value type stored in the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = T;
----

Constructors

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Default constructs an empty optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-066[optional]() noexcept;
----

[.small]#link:#beman-optional-optional-03-2constructor-066[_» more&period;&period;&period;_]#

Copy constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-06c[optional](link:#beman-optional-optional-03[optional] const& other)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; = default;
----

[.small]#link:#beman-optional-optional-03-2constructor-06c[_» more&period;&period;&period;_]#

Copy constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-0c[optional](link:#beman-optional-optional-03[optional] const& rhs)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; (!std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt;);
----

[.small]#link:#beman-optional-optional-03-2constructor-0c[_» more&period;&period;&period;_]#

Constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
link:#beman-optional-optional-03-2constructor-04a[optional](link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires (detail&colon;&colon;enable&lowbar;from&lowbar;other&lt;T, U, const U&amp;&gt;);
----

[.small]#link:#beman-optional-optional-03-2constructor-04a[_» more&period;&period;&period;_]#

Move constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-05[optional](link:#beman-optional-optional-03[optional]&& other)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; = default;
----

[.small]#link:#beman-optional-optional-03-2constructor-05[_» more&period;&period;&period;_]#

Move constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-0b[optional](link:#beman-optional-optional-03[optional]&& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; (!std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;);
----

[.small]#link:#beman-optional-optional-03-2constructor-0b[_» more&period;&period;&period;_]#

Constructs the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
link:#beman-optional-optional-03-2constructor-06e[optional](link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs)
requires (detail&colon;&colon;enable&lowbar;from&lowbar;other&lt;T, U, U &amp;&amp;&gt;);
----

[.small]#link:#beman-optional-optional-03-2constructor-06e[_» more&period;&period;&period;_]#

Constructs an empty optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2constructor-043[optional](link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

[.small]#link:#beman-optional-optional-03-2constructor-043[_» more&period;&period;&period;_]#

Constructs the value from `u,` forwarding it if necessary&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = T&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
link:#beman-optional-optional-03-2constructor-00[optional](U&& u)
requires detail&colon;&colon;enable&lowbar;forward&lowbar;value&lt;T, U&gt;;
----

[.small]#link:#beman-optional-optional-03-2constructor-00[_» more&period;&period;&period;_]#

Constructs the value in&hyphen;place using the given arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
constexpr
explicit
link:#beman-optional-optional-03-2constructor-02a[optional](
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    Args&period;&period;&period;&&&period;&period;&period; args)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;;
----

[.small]#link:#beman-optional-optional-03-2constructor-02a[_» more&period;&period;&period;_]#

Constructs the value in&hyphen;place using the given arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class U,
    class&period;&period;&period; Args&gt;
constexpr
explicit
link:#beman-optional-optional-03-2constructor-07[optional](
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&amp;&amp;&period;&period;&period;&gt;;
----

[.small]#link:#beman-optional-optional-03-2constructor-07[_» more&period;&period;&period;_]#

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

Default constructs an empty optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional() noexcept;
----

Copy constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-optional-03[optional] const& other)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; = default;
----

== Description

Defaulted if T is trivially copy constructible&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

Copy constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-optional-03[optional] const& rhs)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; (!std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt;);
----

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to copy construct from
|===

Constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires (detail&colon;&colon;enable&lowbar;from&lowbar;other&lt;T, U, const U&amp;&gt;);
----

== Description

Converting copy constructor&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to copy construct from
|===

Move constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-optional-03[optional]&& other)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; = default;
----

== Description

Defaulted if T is trivially move constructible&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move construct from
|===

Move constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-optional-03[optional]&& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; (!std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;);
----

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to move construct from
|===

Constructs the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs)
requires (detail&colon;&colon;enable&lowbar;from&lowbar;other&lt;T, U, U &amp;&amp;&gt;);
----

== Description

Converting move constructor&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to move construct from
|===

Constructs an empty optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

Constructs the value from `u,` forwarding it if necessary&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = T&gt;
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T&gt;)
optional(U&& u)
requires detail&colon;&colon;enable&lowbar;forward&lowbar;value&lt;T, U&gt;;
----

== Description

If `u` is convertible to `T,` this is an explicit constructor&period;

Constructs the stored value with `u`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The object to move construct from
|===

Constructs the value in&hyphen;place using the given arguments&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
constexpr
explicit
optional(
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    Args&period;&period;&period;&&&period;&period;&period; args)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;;
----

== Description

Constructs the stored value in&hyphen;place using the given arguments&period;

Constructs the value in&hyphen;place using the given arguments&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class U,
    class&period;&period;&period; Args&gt;
constexpr
explicit
optional(
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&amp;&amp;&period;&period;&period;&gt;;
----

Destructors

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Destructs the optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2destructor-0b[&#126;optional]()
requires std&colon;&colon;is&lowbar;trivially&lowbar;destructible&lowbar;v&lt;T&gt; = default;
----

[.small]#link:#beman-optional-optional-03-2destructor-0b[_» more&period;&period;&period;_]#

Destroys the optional and its value if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-2destructor-0e[&#126;optional]()
requires (!std&colon;&colon;is&lowbar;trivially&lowbar;destructible&lowbar;v&lt;T&gt;);
----

[.small]#link:#beman-optional-optional-03-2destructor-0e[_» more&period;&period;&period;_]#

Destructs the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&#126;optional()
requires std&colon;&colon;is&lowbar;trivially&lowbar;destructible&lowbar;v&lt;T&gt; = default;
----

Destroys the optional and its value if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&#126;optional()
requires (!std&colon;&colon;is&lowbar;trivially&lowbar;destructible&lowbar;v&lt;T&gt;);
----

Assignment operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Copy assigns the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional]&
link:#beman-optional-optional-03-operator_assign-06[operator&equals;](link:#beman-optional-optional-03[optional] const& other)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
                     std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; = default;
----

[.small]#link:#beman-optional-optional-03-operator_assign-06[_» more&period;&period;&period;_]#

Copy assigns the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-09[operator&equals;](link:#beman-optional-optional-03[optional] const& rhs)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
             (!std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt;);
----

[.small]#link:#beman-optional-optional-03-operator_assign-09[_» more&period;&period;&period;_]#

Assigns the stored value from `rhs` if it has one, destroying the old value if there


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-08[operator&equals;](link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires (detail&colon;&colon;enable&lowbar;assign&lowbar;from&lowbar;other&lt;T, U, const U&amp;&gt;);
----

[.small]#link:#beman-optional-optional-03-operator_assign-08[_» more&period;&period;&period;_]#

Move assigns the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional]&
link:#beman-optional-optional-03-operator_assign-0d[operator&equals;](link:#beman-optional-optional-03[optional]&& other)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
                     std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; = default;
----

[.small]#link:#beman-optional-optional-03-operator_assign-0d[_» more&period;&period;&period;_]#

Move assigns the value from `rhs` if it has one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-0b8[operator&equals;](link:#beman-optional-optional-03[optional]&& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
             (!std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt;);
----

[.small]#link:#beman-optional-optional-03-operator_assign-0b8[_» more&period;&period;&period;_]#

Assigns the stored value from `rhs` if it has one, destroying the old value if there


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-07[operator&equals;](link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs)
requires (detail&colon;&colon;enable&lowbar;assign&lowbar;from&lowbar;other&lt;T, U, U&gt;);
----

[.small]#link:#beman-optional-optional-03-operator_assign-07[_» more&period;&period;&period;_]#

Resets the optional to an empty state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-0f[operator&equals;](link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

[.small]#link:#beman-optional-optional-03-operator_assign-0f[_» more&period;&period;&period;_]#

Assigns the stored value from `u,` destroying the old value if there


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = T&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
link:#beman-optional-optional-03-operator_assign-0b6[operator&equals;](U&& u)
requires detail&colon;&colon;enable&lowbar;assign&lowbar;forward&lt;T, U&gt;;
----

[.small]#link:#beman-optional-optional-03-operator_assign-0b6[_» more&period;&period;&period;_]#

== Return Value

optional&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Copy assigns the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional]&
operator&equals;(link:#beman-optional-optional-03[optional] const& other)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
                     std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; = default;
----

== Return Value

optional&amp;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy assign from
|===

Copy assigns the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(link:#beman-optional-optional-03[optional] const& rhs)
requires std&colon;&colon;is&lowbar;copy&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
             (!std&colon;&colon;is&lowbar;trivially&lowbar;copy&lowbar;assignable&lowbar;v&lt;T&gt;);
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to copy assign from
|===

Assigns the stored value from `rhs` if it has one, destroying the old value if there

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires (detail&colon;&colon;enable&lowbar;assign&lowbar;from&lowbar;other&lt;T, U, const U&amp;&gt;);
----

== Description

Converting copy assignment operator&period;

Copies the value from `rhs` if there is one&period; Otherwise resets the stored value in `&ast;this`&period;

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to copy assign from
|===

Move assigns the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional]&
operator&equals;(link:#beman-optional-optional-03[optional]&& other)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
                     std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; = default;
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move assign from
|===

Move assigns the value from `rhs` if it has one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(link:#beman-optional-optional-03[optional]&& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt;)
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt; &amp;&amp;
             (!std&colon;&colon;is&lowbar;trivially&lowbar;move&lowbar;assignable&lowbar;v&lt;T&gt;);
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to move assign from
|===

Assigns the stored value from `rhs` if it has one, destroying the old value if there

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs)
requires (detail&colon;&colon;enable&lowbar;assign&lowbar;from&lowbar;other&lt;T, U, U&gt;);
----

== Description

Converting move assignment operator&period;

Moves the value from `rhs` if there is one&period; Otherwise resets the stored value in `&ast;this`&period;

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to move assign from
|===

Resets the optional to an empty state&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to assign from
|===

Assigns the stored value from `u,` destroying the old value if there

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = T&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]&
operator&equals;(U&& u)
requires detail&colon;&colon;enable&lowbar;assign&lowbar;forward&lt;T, U&gt;;
----

== Description

Assigns the stored value from `u`, destroying the old value if there was one&period;

== Return Value

optional&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Returns an optional containing the result of applying `f` to the stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns an optional containing the result of applying `f` to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-and_then-08[and&lowbar;then](F&& f) const &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-and_then-08[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-and_then-0c[and&lowbar;then](F&& f) const &amp;;
----

[.small]#link:#beman-optional-optional-03-and_then-0c[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-and_then-0d[and&lowbar;then](F&& f) &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-and_then-0d[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-and_then-03[and&lowbar;then](F&& f) &amp;;
----

[.small]#link:#beman-optional-optional-03-and_then-03[_» more&period;&period;&period;_]#

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
and&lowbar;then(F&& f) const &amp;&amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
and&lowbar;then(F&& f) const &amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
and&lowbar;then(F&& f) &amp;&amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
and&lowbar;then(F&& f) &amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

`begin` overloads

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns an iterator to the beginning of the optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-iterator[optional&lt;T&gt;::iterator]
link:#beman-optional-optional-03-begin-0a[begin]() noexcept;
----

[.small]#link:#beman-optional-optional-03-begin-0a[_» more&period;&period;&period;_]#

Returns a const iterator to the beginning of the optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-const_iterator[optional&lt;T&gt;::const&lowbar;iterator]
link:#beman-optional-optional-03-begin-00[begin]() const noexcept;
----

[.small]#link:#beman-optional-optional-03-begin-00[_» more&period;&period;&period;_]#

== Return Value

const&lowbar;iterator

Returns an iterator to the beginning of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-iterator[optional&lt;T&gt;::iterator]
begin() noexcept;
----

== Return Value

an iterator to the beginning of the optional&period;

Returns a const iterator to the beginning of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-const_iterator[optional&lt;T&gt;::const&lowbar;iterator]
begin() const noexcept;
----

== Return Value

const&lowbar;iterator

`emplace` overloads

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Constructs the value in&hyphen;place, destroying the current one if there


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
constexpr
T&
link:#beman-optional-optional-03-emplace-04[emplace](Args&period;&period;&period;&&&period;&period;&period; args);
----

[.small]#link:#beman-optional-optional-03-emplace-04[_» more&period;&period;&period;_]#

Constructs the value in&hyphen;place using the given arguments, destroying the current one if there


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class U,
    class&period;&period;&period; Args&gt;
constexpr
T&
link:#beman-optional-optional-03-emplace-08[emplace](
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args);
----

[.small]#link:#beman-optional-optional-03-emplace-08[_» more&period;&period;&period;_]#

== Return Value

T&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *Args*
| 
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *args*
| 
| *il*
| 
|===

Constructs the value in&hyphen;place, destroying the current one if there

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
constexpr
T&
emplace(Args&period;&period;&period;&&&period;&period;&period; args);
----

== Description

Constructs the value in&hyphen;place, destroying the current one if there is one&period;

== Return Value

T&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *Args*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *args*
| 
|===

Constructs the value in&hyphen;place using the given arguments, destroying the current one if there

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class U,
    class&period;&period;&period; Args&gt;
constexpr
T&
emplace(
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args);
----

== Return Value

T&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
| *Args*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *il*
| 
| *args*
| 
|===

`end` overloads

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns an iterator to the end of the optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-iterator[optional&lt;T&gt;::iterator]
link:#beman-optional-optional-03-end-05[end]() noexcept;
----

[.small]#link:#beman-optional-optional-03-end-05[_» more&period;&period;&period;_]#

Returns a const iterator to the end of the optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-const_iterator[optional&lt;T&gt;::const&lowbar;iterator]
link:#beman-optional-optional-03-end-02[end]() const noexcept;
----

[.small]#link:#beman-optional-optional-03-end-02[_» more&period;&period;&period;_]#

== Return Value

const&lowbar;iterator

Returns an iterator to the end of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-iterator[optional&lt;T&gt;::iterator]
end() noexcept;
----

== Return Value

an iterator to the end of the optional&period;

Returns a const iterator to the end of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-03-const_iterator[optional&lt;T&gt;::const&lowbar;iterator]
end() const noexcept;
----

== Return Value

const&lowbar;iterator

Returns whether or not the optional has a value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
has&lowbar;value() const noexcept;
----

== Description

Returns whether or not the optional has a value

== Return Value

bool

Returns a reference to the stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
link:#beman-optional-optional-03-operator_star-092[operator&ast;]() &amp;;
----

[.small]#link:#beman-optional-optional-03-operator_star-092[_» more&period;&period;&period;_]#

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const&
link:#beman-optional-optional-03-operator_star-06[operator&ast;]() const &amp;;
----

[.small]#link:#beman-optional-optional-03-operator_star-06[_» more&period;&period;&period;_]#

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&&
link:#beman-optional-optional-03-operator_star-091[operator&ast;]() &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-operator_star-091[_» more&period;&period;&period;_]#

== Return Value

* T&amp;
* const T&amp;
* T&amp;&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
operator&ast;() &amp;;
----

== Description

Returns the stored value

== Return Value

T&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const&
operator&ast;() const &amp;;
----

== Return Value

const T&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&&
operator&ast;() &amp;&amp;;
----

== Return Value

T&amp;&amp;

Returns a pointer to the stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns a pointer to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const*
link:#beman-optional-optional-03-operator_ptr-093[operator&hyphen;&gt;]() const;
----

[.small]#link:#beman-optional-optional-03-operator_ptr-093[_» more&period;&period;&period;_]#

Returns a pointer to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T*
link:#beman-optional-optional-03-operator_ptr-06[operator&hyphen;&gt;]();
----

[.small]#link:#beman-optional-optional-03-operator_ptr-06[_» more&period;&period;&period;_]#

== Return Value

T&ast;

Returns a pointer to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const*
operator&hyphen;&gt;() const;
----

== Description

Returns a pointer to the stored value

== Return Value

a pointer to the stored value&period;

Returns a pointer to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T*
operator&hyphen;&gt;();
----

== Return Value

T&ast;

Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
link:#beman-optional-optional-03-or_else-04[or&lowbar;else](F&& f) &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-or_else-04[_» more&period;&period;&period;_]#

Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
link:#beman-optional-optional-03-or_else-05[or&lowbar;else](F&& f) const &amp;;
----

[.small]#link:#beman-optional-optional-03-or_else-05[_» more&period;&period;&period;_]#

== Return Value

* auto
* optional&lt;T&gt;
* optional

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
| *T*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
or&lowbar;else(F&& f) &amp;&amp;;
----

== Return Value

* auto
* optional&lt;T&gt;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
| *T*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
or&lowbar;else(F&& f) const &amp;;
----

== Return Value

* optional
* optional&lt;T&gt;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
| *T*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Resets the optional to an empty state, destroying the stored value if there is one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
void
reset() noexcept;
----

Swaps this optional with the other&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
void
swap(link:#beman-optional-optional-03[optional]& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lt;T&gt;&colon;&colon;value &amp;&amp; std&colon;&colon;is&lowbar;nothrow&lowbar;swappable&lt;T&gt;&colon;&colon;value);
----

== Description

Swaps this optional with the other&period;

If neither optionals have a value, nothing happens&period; If both have a value, the values are swapped&period; If one has a value, it is moved to the other and the movee is left valueless&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-transform-070[transform](F&& f) const &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-transform-070[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-transform-01[transform](F&& f) const &amp;;
----

[.small]#link:#beman-optional-optional-03-transform-01[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-transform-0d[transform](F&& f) &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-transform-0d[_» more&period;&period;&period;_]#

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
link:#beman-optional-optional-03-transform-07a[transform](F&& f) &amp;;
----

[.small]#link:#beman-optional-optional-03-transform-07a[_» more&period;&period;&period;_]#

== Return Value

* auto
* optional

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
transform(F&& f) const &amp;&amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
transform(F&& f) const &amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
transform(F&& f) &amp;&amp;;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an optional containing the result of applying `f` to the stored value, or a default value if there is no stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
transform(F&& f) &amp;;
----

== Description

Carries out some operation on the stored object if there is one&period;

== Return Value

optional

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns a reference to the stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
link:#beman-optional-optional-03-value-0d[value]() &amp;;
----

[.small]#link:#beman-optional-optional-03-value-0d[_» more&period;&period;&period;_]#

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const&
link:#beman-optional-optional-03-value-09[value]() const &amp;;
----

[.small]#link:#beman-optional-optional-03-value-09[_» more&period;&period;&period;_]#

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&&
link:#beman-optional-optional-03-value-02a[value]() &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-value-02a[_» more&period;&period;&period;_]#

== Return Value

* T&amp;
* const T&amp;
* T&amp;&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
value() &amp;;
----

== Description

Returns the contained value if there is one, otherwise throws bad&lowbar;optional&lowbar;access

== Return Value

T&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T const&
value() const &amp;;
----

== Return Value

const T&amp;

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&&
value() &amp;&amp;;
----

== Return Value

T&amp;&amp;

Returns a reference to the stored value&period;

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = std::remove&lowbar;cv&lowbar;t&lt;T&gt;&gt;
constexpr
T
link:#beman-optional-optional-03-value_or-0b5[value&lowbar;or](U&& u) const &amp;;
----

[.small]#link:#beman-optional-optional-03-value_or-0b5[_» more&period;&period;&period;_]#

Returns a reference to the stored value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = std::remove&lowbar;cv&lowbar;t&lt;T&gt;&gt;
constexpr
T
link:#beman-optional-optional-03-value_or-0b1[value&lowbar;or](U&& u) &amp;&amp;;
----

[.small]#link:#beman-optional-optional-03-value_or-0b1[_» more&period;&period;&period;_]#

== Return Value

T

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = std::remove&lowbar;cv&lowbar;t&lt;T&gt;&gt;
constexpr
T
value&lowbar;or(U&& u) const &amp;;
----

== Description

Returns the stored value if there is one, otherwise returns `u`

== Return Value

T

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = std::remove&lowbar;cv&lowbar;t&lt;T&gt;&gt;
constexpr
T
value&lowbar;or(U&& u) &amp;&amp;;
----

== Return Value

T

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Converts the optional to a boolean indicating whether it has a value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
operator bool() const noexcept;
----

== Return Value

bool

The empty state of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#beman-optional-optional-03[empty] &lowbar; = &lcub;&rcub;;
----

The stored value of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
T value&lowbar;;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class link:#beman-optional-optional-03[optional]&lt;T&&gt;;
----

== Types

[cols=2]
|===
| Name
| Description
| link:#beman-optional-optional-06-iterator[`iterator`] 
| The type of the iterator for the optional&period;
| link:#beman-optional-optional-06-value_type[`value&lowbar;type`] 
| The type of the value stored in the optional&period;
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#beman-optional-optional-06-2constructor-03[`optional`]         [.small]#[constructor]#
| Constructors
| link:#beman-optional-optional-06-2destructor[`&#126;optional`] [.small]#[destructor]#
| Destructor&period;
| link:#beman-optional-optional-06-operator_assign-0f[`operator&equals;`] 
| Assignment operators
| link:#beman-optional-optional-06-and_then[`and&lowbar;then`] 
| Applies a function to the stored value if there is one&period;
| link:#beman-optional-optional-06-begin[`begin`] 
| Returns an iterator to the beginning of the optional&period;
| link:#beman-optional-optional-06-emplace[`emplace`] 
| Converting copy assignment operator&period;
| link:#beman-optional-optional-06-end[`end`] 
| Returns an iterator to the end of the optional&period;
| link:#beman-optional-optional-06-has_value[`has&lowbar;value`] 
| Checks if the optional has a value&period;
| link:#beman-optional-optional-06-operator_star[`operator&ast;`] 
| Returns a reference to the stored value&period;
| link:#beman-optional-optional-06-operator_ptr[`operator&hyphen;&gt;`] 
| Returns a pointer to the stored value&period;
| link:#beman-optional-optional-06-or_else[`or&lowbar;else`] 
| Calls a function if the optional is empty&period;
| link:#beman-optional-optional-06-reset[`reset`] 
| Resets the optional to an empty state&period;
| link:#beman-optional-optional-06-swap[`swap`] 
| Swaps the contents of this optional with another&period;
| link:#beman-optional-optional-06-transform[`transform`] 
| Applies a function to the stored value if there is one&period;
| link:#beman-optional-optional-06-value[`value`] 
| Returns the stored value if there is one, otherwise throws
| link:#beman-optional-optional-06-value_or[`value&lowbar;or`] 
| Returns the stored value if there is one, otherwise returns `u`&period;
| link:#beman-optional-optional-06-2conversion[`operator bool`] 
| Converts the optional to a boolean value&period;
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#beman-optional-optional-03[beman::optional::optional]`
| 
|===

The type of the iterator for the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using iterator = &sol;&ast; implementation-defined &ast;&sol;::contiguous&lowbar;iterator&lt;T, optional&gt;;
----

The type of the value stored in the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = T;
----

Constructors

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Default constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06-2constructor-070[optional]() noexcept = default;
----

[.small]#link:#beman-optional-optional-06-2constructor-070[_» more&period;&period;&period;_]#

Copy constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06-2constructor-0a3d[optional](link:#beman-optional-optional-06[optional] const& rhs) noexcept = default;
----

[.small]#link:#beman-optional-optional-06-2constructor-0a3d[_» more&period;&period;&period;_]#

Constructs an empty optional&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06-2constructor-008[optional](link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

[.small]#link:#beman-optional-optional-06-2constructor-008[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&amp;&gt;)
constexpr
link:#beman-optional-optional-06-2constructor-01d[optional](link:#beman-optional-optional-03[optional&lt;U&gt;]& rhs) = delete;
----

[.small]#link:#beman-optional-optional-06-2constructor-01d[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&amp;&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U &amp;, T &amp;&gt;)
link:#beman-optional-optional-06-2constructor-0fa[optional](link:#beman-optional-optional-03[optional&lt;U&gt;]& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U &amp;&gt;);
----

[.small]#link:#beman-optional-optional-06-2constructor-0fa[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&amp;&gt;)
constexpr
link:#beman-optional-optional-06-2constructor-07d[optional](link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs) = delete;
----

[.small]#link:#beman-optional-optional-06-2constructor-07d[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&amp;&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;const U &amp;, T &amp;&gt;)
link:#beman-optional-optional-06-2constructor-0a31[optional](link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, const U &amp;&gt;);
----

[.small]#link:#beman-optional-optional-06-2constructor-0a31[_» more&period;&period;&period;_]#

Constructs an optional from a U, but deletes the constructor if


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, in&lowbar;place&lowbar;t&gt;) &amp;&amp;
                 !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, optional&gt;) &amp;&amp;
                 detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
link:#beman-optional-optional-06-2constructor-004[optional](U&& u) = delete;
----

[.small]#link:#beman-optional-optional-06-2constructor-004[_» more&period;&period;&period;_]#

Construct from a U


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, in&lowbar;place&lowbar;t&gt;) &amp;&amp;
                 !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, optional&gt;) &amp;&amp;
                 !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T &amp;&gt;)
link:#beman-optional-optional-06-2constructor-01a[optional](U&& u) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;);
----

[.small]#link:#beman-optional-optional-06-2constructor-01a[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
link:#beman-optional-optional-06-2constructor-0a36[optional](link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs) = delete;
----

[.small]#link:#beman-optional-optional-06-2constructor-0a36[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T &amp;&gt;)
link:#beman-optional-optional-06-2constructor-08[optional](link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs) noexcept(noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;));
----

[.small]#link:#beman-optional-optional-06-2constructor-08[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&gt;)
constexpr
link:#beman-optional-optional-06-2constructor-04[optional](link:#beman-optional-optional-03[optional&lt;U&gt;] const&& rhs) = delete;
----

[.small]#link:#beman-optional-optional-06-2constructor-04[_» more&period;&period;&period;_]#

Constructs an optional from another optional of type U&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;const U, T &amp;&gt;)
link:#beman-optional-optional-06-2constructor-05[optional](link:#beman-optional-optional-03[optional&lt;U&gt;] const&& rhs) noexcept(noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, const U&gt;));
----

[.small]#link:#beman-optional-optional-06-2constructor-05[_» more&period;&period;&period;_]#

In&hyphen;place constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Arg&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, Arg&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, Arg&gt;)
constexpr
explicit
link:#beman-optional-optional-06-2constructor-0f8[optional](
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    Arg&& arg);
----

[.small]#link:#beman-optional-optional-06-2constructor-0f8[_» more&period;&period;&period;_]#

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
| *Arg*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
| *u*
| 
| *arg*
| 
|===

Default constructor&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional() noexcept = default;
----

Copy constructor&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-optional-06[optional] const& rhs) noexcept = default;
----

== Description

Constructs an empty optional if the rhs is empty, otherwise constructs the stored value from the rhs&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| The object to copy construct from
|===

Constructs an empty optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
optional(link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

Constructs an optional from another optional of type U

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&amp;&gt;)
constexpr
optional(link:#beman-optional-optional-03[optional&lt;U&gt;]& rhs) = delete;
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&amp;&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U &amp;, T &amp;&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;]& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U &amp;&gt;);
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&amp;&gt;)
constexpr
optional(link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs) = delete;
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&amp;&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&amp;&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;const U &amp;, T &amp;&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, const U &amp;&gt;);
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from a U, but deletes the constructor if

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, in&lowbar;place&lowbar;t&gt;) &amp;&amp;
                 !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, optional&gt;) &amp;&amp;
                 detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
optional(U&& u) = delete;
----

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The object to move construct from
|===

Construct from a U

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, in&lowbar;place&lowbar;t&gt;) &amp;&amp;
                 !(std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;U&gt;, optional&gt;) &amp;&amp;
                 !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T &amp;&gt;)
optional(U&& u) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;);
----

== Description

Constructs the stored value from `u` if it is convertible to `T&amp;`&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Constructs an optional from another optional of type U

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
optional(link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs) = delete;
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;U, T &amp;&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;]&& rhs) noexcept(noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;));
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
                 !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&gt;)
constexpr
optional(link:#beman-optional-optional-03[optional&lt;U&gt;] const&& rhs) = delete;
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Constructs an optional from another optional of type U&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, const U&gt; &amp;&amp; !std&colon;&colon;is&lowbar;same&lowbar;v&lt;std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;, optional&lt;U&gt;&gt; &amp;&amp;
             !std&colon;&colon;is&lowbar;same&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, const U&gt;)
constexpr
explicit(!std&colon;&colon;is&lowbar;convertible&lowbar;v&lt;const U, T &amp;&gt;)
optional(link:#beman-optional-optional-03[optional&lt;U&gt;] const&& rhs) noexcept(noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, const U&gt;));
----

== Description

Constructs the stored value from the rhs if it has a value, otherwise constructs an empty optional&period; If `T&amp;` can be constructed from a temporary, this constructor is deleted to prevent binding a temporary to a reference&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

In&hyphen;place constructor&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Arg&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, Arg&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, Arg&gt;)
constexpr
explicit
optional(
    link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t],
    Arg&& arg);
----

== Template Parameters

[cols=2]
|===
| Name
| Description
| *Arg*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *arg*
| 
|===

Destructor&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&#126;optional() = default;
----

== Description

Does not destroy the stored value, as it is a reference&period;

Assignment operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Copy assignment operator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06[optional]&
link:#beman-optional-optional-06-operator_assign-04[operator&equals;](link:#beman-optional-optional-06[optional] const& rhs) noexcept = default;
----

[.small]#link:#beman-optional-optional-06-operator_assign-04[_» more&period;&period;&period;_]#

Assignment operator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06[optional&lt;T&&gt;]&
link:#beman-optional-optional-06-operator_assign-0e[operator&equals;](link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

[.small]#link:#beman-optional-optional-06-operator_assign-0e[_» more&period;&period;&period;_]#

== Return Value

optional&amp;

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Copy assignment operator&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06[optional]&
operator&equals;(link:#beman-optional-optional-06[optional] const& rhs) noexcept = default;
----

== Return Value

optional&amp;

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Assignment operator&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06[optional&lt;T&&gt;]&
operator&equals;(link:#beman-optional-nullopt_t[nullopt&lowbar;t] value) noexcept;
----

== Return Value

optional&amp;

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to assign from
|===

Applies a function to the stored value if there is one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
auto
and&lowbar;then(F&& f) const;
----

== Return Value

auto

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns an iterator to the beginning of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06-iterator[optional&lt;T&&gt;::iterator]
begin() const noexcept;
----

== Return Value

iterator

Converting copy assignment operator&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
T&
emplace(U&& u) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;);
----

== Description

If `rhs` has a value, assigns it to the stored value&period; Otherwise resets the stored value in `&ast;this`&period; If `T&amp;` can be constructed from a temporary, this assignment operator is deleted to prevent binding a temporary to a reference&period;

== Return Value

optional&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Returns an iterator to the end of the optional&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#beman-optional-optional-06-iterator[optional&lt;T&&gt;::iterator]
end() const noexcept;
----

== Return Value

iterator

Checks if the optional has a value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
has&lowbar;value() const noexcept;
----

== Return Value

bool

Returns a reference to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
operator&ast;() const noexcept;
----

== Return Value

T&amp;

Returns a pointer to the stored value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T*
operator&hyphen;&gt;() const noexcept;
----

== Return Value

T&ast;

Calls a function if the optional is empty&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-06[optional&lt;T&&gt;]
or&lowbar;else(F&& f) const;
----

== Return Value

* optional
* optional&lt;T&amp;&gt;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
| *T*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Resets the optional to an empty state&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
void
reset() noexcept;
----

Swaps the contents of this optional with another&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
void
swap(link:#beman-optional-optional-06[optional]& rhs) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *rhs*
| 
|===

Applies a function to the stored value if there is one&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;std::invoke&lowbar;result&lowbar;t&lt;F, T&&gt;&gt;]
transform(F&& f) const;
----

== Return Value

optional&lt;std&colon;&colon;invoke&lowbar;result&lowbar;t&lt;F, T&amp;&gt;&gt;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *F*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *f*
| 
|===

Returns the stored value if there is one, otherwise throws

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
T&
value() const;
----

== Return Value

T&amp;

Returns the stored value if there is one, otherwise returns `u`&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = std::remove&lowbar;cv&lowbar;t&lt;T&gt;&gt;
constexpr
std::remove&lowbar;cv&lowbar;t&lt;T&gt;
value&lowbar;or(U&& u) const;
----

== Return Value

std&colon;&colon;remove&lowbar;cv&lowbar;t&lt;T&gt;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===

Converts the optional to a boolean value&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
operator bool() const noexcept;
----

== Return Value

bool

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int = 0,
    class T&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;std::decay&lowbar;t&lt;T&gt;&gt;]
link:#beman-optional-make_optional-04[make&lowbar;optional](T&& t) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;optional&lt;std&colon;&colon;decay&lowbar;t&lt;T&gt;&gt;, T&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;std&colon;&colon;decay&lowbar;t&lt;T&gt;, T&gt;;
----

[.small]#link:#beman-optional-make_optional-04[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename&period;&period;&period; Args&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
link:#beman-optional-make_optional-00[make&lowbar;optional](Args&period;&period;&period;&&&period;&period;&period; args) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;;
----

[.small]#link:#beman-optional-make_optional-00[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U,
    typename&period;&period;&period; Args&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
link:#beman-optional-make_optional-0f[make&lowbar;optional](
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt; &amp;, Args&period;&period;&period;&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&period;&period;&period;&gt;;
----

[.small]#link:#beman-optional-make_optional-0f[_» more&period;&period;&period;_]#

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int = 0,
    class T&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;std::decay&lowbar;t&lt;T&gt;&gt;]
make&lowbar;optional(T&& t) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;optional&lt;std&colon;&colon;decay&lowbar;t&lt;T&gt;&gt;, T&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;std&colon;&colon;decay&lowbar;t&lt;T&gt;, T&gt;;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename&period;&period;&period; Args&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
make&lowbar;optional(Args&period;&period;&period;&&&period;&period;&period; args) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U,
    typename&period;&period;&period; Args&gt;
constexpr
link:#beman-optional-optional-03[optional&lt;T&gt;]
make&lowbar;optional(
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&period;&period;&period;&&&period;&period;&period; args) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt; &amp;, Args&period;&period;&period;&gt;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&period;&period;&period;&gt;;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
void
swap(
    link:#beman-optional-optional-03[optional&lt;T&gt;]& x,
    link:#beman-optional-optional-03[optional&lt;T&gt;]& y) noexcept(noexcept(lhs&period;swap(rhs)))
requires std&colon;&colon;is&lowbar;move&lowbar;constructible&lowbar;v&lt;T&gt; &amp;&amp; std&colon;&colon;is&lowbar;swappable&lowbar;v&lt;T&gt;;
----

Equality operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Equality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_eq-08[operator&equals;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_eq-08[_» more&period;&period;&period;_]#

Equality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
bool
link:#beman-optional-operator_eq-00[operator&equals;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-nullopt_t[nullopt&lowbar;t] rhs) noexcept;
----

[.small]#link:#beman-optional-operator_eq-00[_» more&period;&period;&period;_]#

Equality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_eq-09[operator&equals;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_eq-09[_» more&period;&period;&period;_]#

Equality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_eq-0b3[operator&equals;&equals;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_eq-0b3[_» more&period;&period;&period;_]#

Equality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&equals;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Equality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
bool
operator&equals;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-nullopt_t[nullopt&lowbar;t] rhs) noexcept;
----

== Return Value

`true` if the objects are equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Equality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&equals;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Equality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&equals;&equals;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;eq&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Inequality operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Inequality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_not_eq-0e[operator!&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_not_eq-0e[_» more&period;&period;&period;_]#

Inequality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_not_eq-0d8[operator!&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_not_eq-0d8[_» more&period;&period;&period;_]#

Inequality operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_not_eq-0d5[operator!&equals;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_not_eq-0d5[_» more&period;&period;&period;_]#

Inequality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator!&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are not equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Inequality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator!&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are not equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Inequality operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator!&equals;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ne&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the objects are not equal, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Less&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_lt-0d[operator&lt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_lt-0d[_» more&period;&period;&period;_]#

Less&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_lt-08[operator&lt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_lt-08[_» more&period;&period;&period;_]#

Less&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_lt-04[operator&lt;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_lt-04[_» more&period;&period;&period;_]#

Less&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;lt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than&hyphen;or&hyphen;equal operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Less&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_le-01[operator&lt;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_le-01[_» more&period;&period;&period;_]#

Less&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_le-0f[operator&lt;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_le-0f[_» more&period;&period;&period;_]#

Less&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_le-0c[operator&lt;&equals;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_le-0c[_» more&period;&period;&period;_]#

Less&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Less&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&lt;&equals;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;le&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is less than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Greater&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_gt-08[operator&gt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_gt-08[_» more&period;&period;&period;_]#

Greater&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_gt-0d[operator&gt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_gt-0d[_» more&period;&period;&period;_]#

Greater&hyphen;than operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_gt-03[operator&gt;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_gt-03[_» more&period;&period;&period;_]#

Greater&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;gt&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than&hyphen;or&hyphen;equal operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Greater&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_ge-0f[operator&gt;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_ge-0f[_» more&period;&period;&period;_]#

Greater&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_ge-00[operator&gt;&equals;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_ge-00[_» more&period;&period;&period;_]#

Greater&hyphen;than&hyphen;or&hyphen;equal operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
link:#beman-optional-operator_ge-0d[operator&gt;&equals;](
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

[.small]#link:#beman-optional-operator_ge-0d[_» more&period;&period;&period;_]#

Greater&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;&equals;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& lhs,
    U const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Greater&hyphen;than&hyphen;or&hyphen;equal operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
constexpr
bool
operator&gt;&equals;(
    T const& lhs,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& rhs)
requires detail&colon;&colon;optional&lowbar;ge&lowbar;rel&lt;T, U&gt;;
----

== Return Value

`true` if the left object is greater than or equal to the right object, `false` otherwise

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left operand
| *rhs*
| The right operand
|===

Three&hyphen;way comparison operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    std::three&lowbar;way&lowbar;comparable&lowbar;with&lt;T&gt; U&gt;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
link:#beman-optional-operator_3way-0a[operator&lt;&equals;&gt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& y);
----

[.small]#link:#beman-optional-operator_3way-0a[_» more&period;&period;&period;_]#

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
std::strong&lowbar;ordering
link:#beman-optional-operator_3way-02[operator&lt;&equals;&gt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    link:#beman-optional-nullopt_t[nullopt&lowbar;t] rhs) noexcept;
----

[.small]#link:#beman-optional-operator_3way-02[_» more&period;&period;&period;_]#

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
requires (!is&lowbar;derived&lowbar;from&lowbar;optional&lt;U&gt;) &amp;&amp; std&colon;&colon;three&lowbar;way&lowbar;comparable&lowbar;with&lt;T, U&gt;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
link:#beman-optional-operator_3way-09[operator&lt;&equals;&gt;](
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    U const& v);
----

[.small]#link:#beman-optional-operator_3way-09[_» more&period;&period;&period;_]#

Three&hyphen;way comparison operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    std::three&lowbar;way&lowbar;comparable&lowbar;with&lt;T&gt; U&gt;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
operator&lt;&equals;&gt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    link:#beman-optional-optional-03[optional&lt;U&gt;] const& y);
----

== Return Value

The relative order of the objects

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The left operand
| *y*
| The right operand
|===

Three&hyphen;way comparison operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
std::strong&lowbar;ordering
operator&lt;&equals;&gt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    link:#beman-optional-nullopt_t[nullopt&lowbar;t] rhs) noexcept;
----

== Return Value

The relative order of the objects

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The left operand
| *rhs*
| The right operand
|===

Three&hyphen;way comparison operator

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
requires (!is&lowbar;derived&lowbar;from&lowbar;optional&lt;U&gt;) &amp;&amp; std&colon;&colon;three&lowbar;way&lowbar;comparable&lowbar;with&lt;T, U&gt;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
operator&lt;&equals;&gt;(
    link:#beman-optional-optional-03[optional&lt;T&gt;] const& x,
    U const& v);
----

== Return Value

The relative order of the objects

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The left operand
| *v*
| The right operand
|===

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr link:#beman-optional-in_place_t[in&lowbar;place&lowbar;t] in&lowbar;place = in&lowbar;place&lcub;&rcub;;
----

Tag to disengage optional objects&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr link:#beman-optional-nullopt_t[nullopt&lowbar;t] nullopt = nullopt&lcub;nullopt&lowbar;t&colon;&colon;Tag&colon;&colon;tag&rcub;;
----

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
concept is&lowbar;derived&lowbar;from&lowbar;optional = requires(const T&amp; t) &lcub; &sol;&sol; exposition only
    &lsqb;&rsqb;&lt;class U&gt;(const optional&lt;U&gt;&amp;) &lcub;&rcub;(t)&semi;
&rcub;;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
