Create a nullable object from original using allocator.

Synopsis

Declared in <bdlb_nullablevalue.h>

template<class BDE_OTHER_TYPE>
NullableValue(
    NullableValue<BDE_OTHER_TYPE> const& original,
    allocator_type const& allocator);

Description

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.

Parameters

Name

Description

original

source nullable value to convert

allocator

allocator used to supply memory

Created with MrDocs