Destructively move a TARGET_TYPE from original to address.
Synopsis
Declared in <bslalg_scalarprimitives.h>
template<
class TARGET_TYPE,
class ALLOCATOR>
static
void
destructiveMove(
TARGET_TYPE* address,
TARGET_TYPE* original,
ALLOCATOR* allocator);
Description
Move the state of the object of the parameterized TARGET_TYPE from the object at the specified original address to the uninitialized memory at the specified address, as if by move constructing and then destroying the original. If the parameterized ALLOCATOR is based on bslma::Allocator and TARGET_TYPE takes an allocator constructor argument, then the moved object uses the specified allocator to supply memory. If the move constructor throws, the address is left in an uninitialized state and the original is left unchanged. The behavior is undefined unless the original object also uses the allocator. Note that bit‐wise copy will be used and allocator will be ignored if TARGET_TYPE' has the bit‐wise moveable trait. Note that, if ALLOCATOR is not based on bslma::Allocator, then the allocator argument is ignored; the allocator used by the resulting object at address might or might not be the same as the allocator used by original, depending on whether TARGET_TYPE has a move constructor (C++11).
Parameters
Name |
Description |
address |
address of uninitialized storage for the moved object |
original |
address of the object to move from and then destroy |
allocator |
allocator to use if the type uses an allocator |
Created with MrDocs