[#BloombergLP-bdlb-ConstNullableValueRef]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::ConstNullableValueRef
:relfileprefix: ../../
:mrdocs:

This class is a wrapper for either a `bsl&colon;&colon;optional` or `NullableAllocatedValue`, and provides non&hyphen;modifiable access to the wrapped object&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;nullablevalueref&period;h&gt;`

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

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/ConstNullableValueRef/value_type.adoc[`value&lowbar;type`] 
| `value&lowbar;type` is an alias for the template parameter `TYPE`, and represents the type of the object managed by the wrapped nullable object&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/ConstNullableValueRef/2constructor-05.adoc[`ConstNullableValueRef`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlb/ConstNullableValueRef/addressOr.adoc[`addressOr`] 
| Return an address providing non&hyphen;modifiable access to the underlying object of a (template parameter) `TYPE` if this object is non&hyphen;null, and the specified `address` otherwise&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/has_value.adoc[`has&lowbar;value`] 
| Return `true` if the target contains a value, and `false` otherwise&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/isNull.adoc[`isNull`] 
| Return `false` if the target contains a value, and `true` otherwise&period; Note that this accessor is provided purely for compatibility with `NullableValue` and `NullableAllocatedValue`, and its use is discouraged in favor of `has&lowbar;value`&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/operator_star.adoc[`operator&ast;`] 
| Return a reference providing non&hyphen;modifiable access to the underlying `TYPE` object&period; The behavior is undefined if the target has no value&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/operator_ptr.adoc[`operator&hyphen;&gt;`] 
| Return a pointer providing non&hyphen;modifiable access to the underlying `TYPE` object&period; The behavior is undefined if the target has no value&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/value.adoc[`value`] 
| Return a reference providing non&hyphen;modifiable access to the underlying object of a (template parameter) `TYPE`&period; The behavior is undefined if the target has no value&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/valueOr.adoc[`valueOr`] 
| Return the value of the underlying object of a (template parameter) `TYPE` if this object is non&hyphen;null, and the specified `otherValue` otherwise&period; Note that this method returns _by_ _value_, so may be inefficient in some contexts&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/valueOrNull.adoc[`valueOrNull`] 
| Return an address providing non&hyphen;modifiable access to the underlying object of a (template parameter) `TYPE` if this object is non&hyphen;null, and 0 otherwise&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/value_or.adoc[`value&lowbar;or`] 
| Return the value of the underlying object of a (template parameter) `TYPE` if the target is non&hyphen;null, and the specified `default&lowbar;value` otherwise&period; Note that this method returns _by_ _value_, so may be inefficient in some contexts&period;
| xref:BloombergLP/bdlb/ConstNullableValueRef/2conversion.adoc[`operator bool`] 
| Return `true` if the target holds a value, and `false` otherwise&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/operator_not_eq-001.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` nullable objects do not have the same value, and `false` otherwise&period; Two nullable wrappers do not have the same value if one is null and the other is non&hyphen;null, or if both are non&hyphen;null and the values of their underlying objects do not compare equal&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_not_eq-051.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` nullable objects do not have the same value, and `false` otherwise&period; Two nullable wrappers do not have the same value if one is null and the other is non&hyphen;null, or if bost are non&hyphen;null and the values of their underlying objects do not compare equal&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_not_eq-0c0.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` is not null, and `false` otherwise&period;
| xref:BloombergLP/bdlb/operator_not_eq-0eb.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period; A nullable wrappers and a value of some type do not have the same value if either the nullable wrappers is null, or its underlying value does not compare equal to the other value&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_lt-033.adoc[`operator&lt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs` nullable object, and `false` otherwise&period; `lhs` is ordered before `rhs` if `lhs` is null and `rhs` is non&hyphen;null or if both are non&hyphen;null and `lhs&period;value()` is ordered before `rhs&period;value()`&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_lt-054c.adoc[`operator&lt;`]
| Return `false`&period; `bsl&colon;&colon;nullopt` never orders after a `ConstNullableValueRef`&period;
| xref:BloombergLP/bdlb/operator_lt-0f9.adoc[`operator&lt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs`, and `false` otherwise&period; `lhs` is ordered before `rhs` if `lhs` is null or `lhs&period;value()` is ordered before `rhs`&period;
| xref:BloombergLP/bdlb/operator_lt-0fe.adoc[`operator&lt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs` nullable object, and `false` otherwise&period; `lhs` is ordered before `rhs` if `lhs` is null and `rhs` is non&hyphen;null or if both are non&hyphen;null and `lhs&period;value()` is ordered before `rhs&period;value()`&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_le-054.adoc[`operator&lt;&equals;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs` nullable object or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&lt;` and `operator&equals;&equals;`&period;) Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_le-0b.adoc[`operator&lt;&equals;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs` nullable object or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&lt;` and `operator&equals;&equals;`&period;) Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_le-0d.adoc[`operator&lt;&equals;`]
| Return `true` if the specified `lhs` is null, and `false` otherwise&period;
| xref:BloombergLP/bdlb/operator_le-0f6.adoc[`operator&lt;&equals;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered before the specified `rhs` or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&lt;` and `operator&equals;&equals;`&period;) Note that this operator returns `!(rhs &lt; lhs)`&period;
| xref:BloombergLP/bdlb/operator_eq-003.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` nullable wrappers have the same value, and `false` otherwise&period; Two nullable wrappers have the same value if both targets are null, or if both are non&hyphen;null and the values of their underlying objects compare equal&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_eq-01c.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` nullable wrappers have the same value, and `false` otherwise&period; Two nullable wrappers have the same value if both targets are null, or if both are non&hyphen;null and the values of their underlying objects compare equal&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_eq-03cc.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` is null, and `false` otherwise&period;
| xref:BloombergLP/bdlb/operator_eq-04f.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; A nullable wrapper and a value of some type have the same value if the nullable wrapper is non&hyphen;null and the underlying value of it&apos;s target compares equal to the other value&period; Note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_gt-02.adoc[`operator&gt;`]
| Return `true` if the specified `lhs` is not null, and `false` otherwise&period;
| xref:BloombergLP/bdlb/operator_gt-04f.adoc[`operator&gt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered after the specified `rhs`, and `false` otherwise&period; `lhs` is ordered after `rhs` if `lhs` is not null and `lhs&period;value()` is ordered after `rhs`&period; Note that this operator returns `rhs &lt; lhs`&period;
| xref:BloombergLP/bdlb/operator_gt-098.adoc[`operator&gt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered after the specified `rhs` nullable object, and `false` otherwise&period; `lhs` is ordered after `rhs` if `lhs` is non&hyphen;null and `rhs` is null or if both are non&hyphen;null and `lhs&period;value()` is ordered after `rhs&period;value()`&period; Note that this operator returns `rhs &lt; lhs` when both operands are of `NullableValue` type&period; Also note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_gt-0b0.adoc[`operator&gt;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered after the specified `rhs` nullable object, and `false` otherwise&period; `lhs` is ordered after `rhs` if `lhs` is non&hyphen;null and `rhs` is null or if both are non&hyphen;null and `lhs&period;value()` is ordered after `rhs&period;value()`&period; Note that this operator returns `rhs &lt; lhs` when both operands are of `NullableValue` type&period; Also note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_ge-008.adoc[`operator&gt;&equals;`]
| Return `true`&period;
| xref:BloombergLP/bdlb/operator_ge-035.adoc[`operator&gt;&equals;`]
| Return `true` if the specified `lhs` nullable object is ordered after the specified `rhs` nullable wrapper or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&gt;` and `operator&equals;&equals;`&period;) Note that this operator returns `!(lhs &lt; rhs)` when both operands are of `NullableValue` type&period; Also note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_ge-09f9.adoc[`operator&gt;&equals;`]
| Return `true` if the specified `lhs` nullable object is ordered after the specified `rhs` nullable wrapper or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&gt;` and `operator&equals;&equals;`&period;) Note that this operator returns `!(lhs &lt; rhs)` when both operands are of `NullableValue` type&period; Also note that this function will fail to compile if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are not compatible&period;
| xref:BloombergLP/bdlb/operator_ge-0a.adoc[`operator&gt;&equals;`]
| Return `true` if the specified `lhs` nullable wrapper is ordered after the specified `rhs` or `lhs` and `rhs` have the same value, and `false` otherwise&period; (See `operator&gt;` and `operator&equals;&equals;`&period;) Note that this operator returns `!(lhs &lt; rhs)`&period;
|===


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