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.
NullableValue() noexcept;
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.
NullableValue(NullableValue const& original);
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.
template<class BDE_OTHER_TYPE>
explicit
NullableValue(NullableValue<BDE_OTHER_TYPE> const& original);
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.
NullableValue(bslmf::MovableRef<NullableValue> original) noexcept(/* see-below */);
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.
explicit
NullableValue(allocator_type const& allocator) noexcept;
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.
NullableValue(bsl::nullopt_t const&) noexcept;
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.
NullableValue(
bslmf::MovableRef<NullableValue> original,
allocator_type const& allocator);
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.
NullableValue(
NullableValue const& original,
allocator_type const& allocator);
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.
NullableValue(
bsl::nullopt_t const&,
allocator_type const& allocator) noexcept;
Create a nullable object having the same value as the specified value (of NullableValue<BDE_OTHER_TYPE>) converted to TYPE.
template<class BDE_OTHER_TYPE>
NullableValue(
BloombergLP::bslmf::MovableRef_Deduced<NullableValue<BDE_OTHER_TYPE>> value,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
Create a nullable object from the specified optional value.
template<class BDE_OTHER_TYPE>
NullableValue(
BloombergLP::bslmf::MovableRef_Deduced<bsl::optional<BDE_OTHER_TYPE>> value,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
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.
template<class BDE_OTHER_TYPE>
NullableValue(
NullableValue<BDE_OTHER_TYPE> const& original,
allocator_type const& allocator);
Create a nullable object from the specified optional value.
template<class BDE_OTHER_TYPE>
NullableValue(
bsl::optional<BDE_OTHER_TYPE> const& value,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
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.
template<class BDE_OTHER_TYPE>
NullableValue(
BDE_OTHER_TYPE&& value,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_convertible<BDE_OTHER_TYPE,
allocator_type>::value;
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.
template<class BDE_OTHER_TYPE>
NullableValue(
BloombergLP::bslmf::MovableRef_Deduced<NullableValue<BDE_OTHER_TYPE>> value,
allocator_type const& allocator,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
Create a nullable object from the specified value using the specified allocator.
template<class BDE_OTHER_TYPE>
NullableValue(
BloombergLP::bslmf::MovableRef_Deduced<bsl::optional<BDE_OTHER_TYPE>> value,
allocator_type const& allocator,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
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.
template<class BDE_OTHER_TYPE>
NullableValue(
bsl::optional<BDE_OTHER_TYPE> const& value,
allocator_type const& allocator,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value &&
!bsl::is_same<bsl::optional<BDE_OTHER_TYPE>, TYPE>::value;
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.
template<class BDE_OTHER_TYPE>
NullableValue(
BDE_OTHER_TYPE&& value,
allocator_type const& allocator,
EnableType = EnableType())
requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value;
Created with MrDocs