Conditionally assign rhs to *lhs based on allowed.
Declared in <bslma_allocatorutil.h>
template<class t_TYPE>
static
t_TYPE&
assign(
t_TYPE* lhs,
t_TYPE const& rhs,
bsl::true_type allowed);
If the specified allowed tag is bsl::true_type assign the allocator object at the specified lhs address the value of the specified rhs; otherwise, do nothing, and, in both cases, return a modifiable reference to *lhs. The t_TYPE template parameter is typically an allocator type and the allowed flag is typically a propagation trait dependant on the calling context, such as propagate_on_container_copy_assignment or propagate_on_container_move_assignment. Instantiation will fail if allowed is true_type and t_TYPE lacks a publically accessible copy assignment operator. The behavior is undefined unless allowed is true_type or *lhs == rhs before the call.
modifiable reference to *lhs
| Name | Description |
|---|---|
| lhs | address of the object to assign to |
| rhs | value to assign from when allowed is true_type |
| allowed | whether assignment is permitted |