BloombergLP::bdlb::VariantImp::assign

Assign the specified TYPE value to this object.

Synopsis

Declared in <bdlb_variant.h>

template<class TYPE>
VariantImp<TYPES>&
assign(TYPE&& value);

Description

The contents of value are moved to this object with value left in a valid but unspecified state. The value currently held by this variant (if any) is destroyed if that value`s type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold.

Return Value

reference providing modifiable access to this object

Parameters

NameDescription
valuevalue assigned to or stored in this variant