[#mrdocs-Expected-01]
= xref:mrdocs.adoc[mrdocs]::xref:mrdocs/Expected-0a.adoc[Expected]&lt;T&, E&gt;
:relfileprefix: ../
:mrdocs:

Expected specialization for lvalue references&period; Holds either a bound reference to `T` or an unexpected error `E`&period;

== Synopsis

Declared in `&lt;mrdocs&sol;Support&sol;Expected&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T,
    class E&gt;
class xref:mrdocs/Expected-0a.adoc[Expected]&lt;T&, E&gt;;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:mrdocs/Expected-01/error_type.adoc[`error&lowbar;type`] 
| Error type carried when disengaged&period;
| xref:mrdocs/Expected-01/rebind.adoc[`rebind`] 
| Rebind the reference to another value type while keeping `E`&period;
| xref:mrdocs/Expected-01/unexpected_type.adoc[`unexpected&lowbar;type`] 
| Convenience alias for the unexpected wrapper&period;
| xref:mrdocs/Expected-01/value_type.adoc[`value&lowbar;type`] 
| Referenced value type&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:mrdocs/Expected-01/2constructor-04.adoc[`Expected`]         [.small]#[constructor]#
| Constructors
| xref:mrdocs/Expected-01/2destructor.adoc[`&#126;Expected`] [.small]#[destructor]#
| Destroy the held error when disengaged&period;
| xref:mrdocs/Expected-01/operator_assign-0b.adoc[`operator&equals;`] 
| Assignment operators
| xref:mrdocs/Expected-01/and_then-00.adoc[`and&lowbar;then`] 
| `and&lowbar;then` overloads
| xref:mrdocs/Expected-01/emplace-05.adoc[`emplace`] 
| `emplace` overloads
| xref:mrdocs/Expected-01/error-01.adoc[`error`] 
| `error` overloads
| xref:mrdocs/Expected-01/error_or-08.adoc[`error&lowbar;or`] 
| `error&lowbar;or` overloads
| xref:mrdocs/Expected-01/has_value.adoc[`has&lowbar;value`] 
| Check whether the Expected currently contains a reference&period;
| xref:mrdocs/Expected-01/operator_star-068.adoc[`operator&ast;`] 
| Dereference operators
| xref:mrdocs/Expected-01/operator_ptr-05.adoc[`operator&hyphen;&gt;`] 
| Access the bound reference pointer&semi; undefined if disengaged&period;
| xref:mrdocs/Expected-01/or_else-07.adoc[`or&lowbar;else`] 
| `or&lowbar;else` overloads
| xref:mrdocs/Expected-01/swap.adoc[`swap`] 
| Swap state with another reference Expected&period;
| xref:mrdocs/Expected-01/transform-09.adoc[`transform`] 
| `transform` overloads
| xref:mrdocs/Expected-01/transform_error-08.adoc[`transform&lowbar;error`] 
| `transform&lowbar;error` overloads
| xref:mrdocs/Expected-01/value-03.adoc[`value`] 
| `value` overloads
| xref:mrdocs/Expected-01/value_or-0c.adoc[`value&lowbar;or`] 
| `value&lowbar;or` overloads
| xref:mrdocs/Expected-01/2conversion.adoc[`operator bool`] 
| Return true when a reference is bound&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:mrdocs/Expected-01/p_.adoc[`p&lowbar;`] [.small]#[variant member]#
| Pointer to the referenced value when engaged&period;
| xref:mrdocs/Expected-01/unex_.adoc[`unex&lowbar;`] [.small]#[variant member]#
| Stored unexpected error when disengaged&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:mrdocs/operator_eq-087.adoc[mrdocs::operator&equals;&equals;]`
| Equality operator
| `xref:mrdocs/operator_eq-0cf.adoc[mrdocs::operator&equals;&equals;]`
| Equality operator
| `xref:mrdocs/operator_eq-0782.adoc[mrdocs::operator&equals;&equals;]`
| Equality operator
| `xref:mrdocs/swap-00.adoc[mrdocs::swap]`
| 
|===


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