[#BloombergLP-bdlb-NullableValue-2constructor-093] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue]::NullableValue :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdlb_nullablevalue.h>` Create a nullable object having the null value. If `TYPE` takes an optional allocator at construction, use the currently installed default allocator to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-060.adoc[NullableValue]() noexcept; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-060.adoc[_» more..._]# Create a nullable object having the value of the specified `original` object. If `TYPE` takes an optional allocator at construction, use the currently installed default allocator to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-0cd.adoc[NullableValue](xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue] const& original); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0cd.adoc[_» more..._]# Create a nullable object having the null value if the specified `original` object is null, and the value of `original.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. If `TYPE` takes an optional allocator at construction, use the currently installed default allocator to supply memory. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE' are not compatible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> explicit xref:BloombergLP/bdlb/NullableValue/2constructor-0b0.adoc[NullableValue](xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<BDE_OTHER_TYPE>] const& original); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0b0.adoc[_» more..._]# Create a nullable object having the same value as the specified `original` object by moving the contents of `original` to the newly‐created object. If `TYPE` takes an optional allocator at construction, the allocator associated with `original` is propagated for use in the newly‐created object. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-07b.adoc[NullableValue](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<NullableValue>] original) noexcept(/* see-below */); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-07b.adoc[_» more..._]# Create a nullable object that has the null value and that uses the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlb/NullableValue/2constructor-0ca.adoc[NullableValue](xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator) noexcept; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0ca.adoc[_» more..._]# Create a nullable object having the null value. If `TYPE` takes an optional allocator at construction, use the currently installed default allocator to supply memory for subsequent values assigned to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-069.adoc[NullableValue](xref:bsl/nullopt_t.adoc[bsl::nullopt_t] const&) noexcept; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-069.adoc[_» more..._]# Create a nullable object having the same value as the specified `original` object but using the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. The contents of `original` are moved to the newly‐created object using the extended move constructor for `TYPE`. `original` is left in a valid but unspecified state. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-0cb.adoc[NullableValue]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<NullableValue>] original, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0cb.adoc[_» more..._]# Create a nullable object that has the value of the specified `original` object and uses the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-042.adoc[NullableValue]( xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue] const& original, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-042.adoc[_» more..._]# Create a nullable object that has the null value; use the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory for subsequent values assigned to this object. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue/2constructor-099.adoc[NullableValue]( xref:bsl/nullopt_t.adoc[bsl::nullopt_t] const&, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator) noexcept; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-099.adoc[_» more..._]# Create a nullable object having the same value as the specified `value` (of `NullableValue<BDE_OTHER_TYPE>`) converted to `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-05a.adoc[NullableValue]( xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<NullableValue<BDE_OTHER_TYPE>>] value, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-05a.adoc[_» more..._]# Create a nullable object from the specified optional `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-0fd2.adoc[NullableValue]( xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<bsl::optional<BDE_OTHER_TYPE>>] value, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0fd2.adoc[_» more..._]# Create a nullable object that has the null value if the specified `original` object is null, and the value of `original.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. Use the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware. Also note that compilation will fail if this function is called with a `BDE_OTHER_TYPE` that is not convertible to `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-0bf.adoc[NullableValue]( xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<BDE_OTHER_TYPE>] const& original, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0bf.adoc[_» more..._]# Create a nullable object from the specified optional `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-041.adoc[NullableValue]( xref:bsl/optional-072.adoc[bsl::optional<BDE_OTHER_TYPE>] const& value, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-041.adoc[_» more..._]# Create a nullable object having the specified `value` (of `BDE_OTHER_TYPE`) converted to `TYPE`. If `TYPE` takes an optional allocator at construction, use the currently installed default allocator to supply memory. Note that this constructor will not participate in overload resolution unless `BDE_OTHER_TYPE` is convertible to `TYPE` and is not convertible to `allocator_type`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-0fd4.adoc[NullableValue]( BDE_OTHER_TYPE&& value, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_convertible<BDE_OTHER_TYPE, allocator_type>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0fd4.adoc[_» more..._]# Create a nullable object having the same value as the specified `value` (of `NullableValue<BDE_OTHER_TYPE>`) converted to `TYPE`, using the specified `allocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-051.adoc[NullableValue]( xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<NullableValue<BDE_OTHER_TYPE>>] value, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-051.adoc[_» more..._]# Create a nullable object from the specified `value` using the specified `allocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-0c4.adoc[NullableValue]( xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<bsl::optional<BDE_OTHER_TYPE>>] value, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0c4.adoc[_» more..._]# Create a nullable object having the value of the specified `value` (of `BDE_OTHER_TYPE`) converted to `TYPE` and that uses the specified `allocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-0a.adoc[NullableValue]( xref:bsl/optional-072.adoc[bsl::optional<BDE_OTHER_TYPE>] const& value, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value && !bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-0a.adoc[_» more..._]# Create a nullable object that has the specified `value` (of `BDE_OTHER_TYPE`) converted to `TYPE` and that uses the specified `allocator` (e.g., the address of a `bslma::Allocator` object) to supply memory. Note that this constructor will not participate in overload resolution unless `TYPE` is allocator aware and `BDE_OTHER_TYPE` is convertible to `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue/2constructor-070.adoc[NullableValue]( BDE_OTHER_TYPE&& value, xref:BloombergLP/bdlb/NullableValue/allocator_type.adoc[allocator_type] const& allocator, xref:BloombergLP/bdlb/NullableValue.adoc[EnableType] = EnableType()) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/2constructor-070.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#