|
template<class TARGET_TYPE , class ALLOCATOR > |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS >) |
|
template<class TARGET_TYPE , class ALLOCATOR > |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_TRAITS >) |
|
template<class TARGET_TYPE , class ALLOCATOR > |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_NIL_TRAITS >) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS >, ARG1 &argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_TRAITS >, ARG1 &argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_NIL_TRAITS >, ARG1 &argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS >, BSLS_COMPILERFEATURES_FORWARD_REF(ARG1) argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_TRAITS >, BSLS_COMPILERFEATURES_FORWARD_REF(ARG1) argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS> |
static void | construct (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_NIL_TRAITS >, BSLS_COMPILERFEATURES_FORWARD_REF(ARG1) argument1, ARGS &&... arguments) |
|
template<class TARGET_TYPE , class ALLOCATOR > |
static void | destructiveMove (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_BITWISE_MOVABLE_TRAITS >, TARGET_TYPE *original) |
|
template<class TARGET_TYPE , class ALLOCATOR > |
static void | destructiveMove (TARGET_TYPE *address, const ALLOCATOR &allocator, bsl::integral_constant< int, e_NIL_TRAITS >, TARGET_TYPE *original) |
|
template<class TARGET_TYPE > |
static void * | voidify (TARGET_TYPE *address) |
|
This struct
provides a namespace for a suite of utility functions that are used to implement functions in ConstructionUtil
. In particular, they provide overloads, resolved at compile-time, for various features (e.g., passing down the allocator to sub-elements of pair
-like types) and optimizations (e.g., bypassing the call to the constructor for classes with trivial default and copy constructors). These functions should not be used outside this component.
template<class TARGET_TYPE , class ALLOCATOR , class ARG1 , class... ARGS>
Construct an instance of (template parameter) TARGET_TYPE
at the specified address
forwarding to the constructor the specified argument1
and arguments
arguments and passing the specified allocator
using the leading or trailing allocator convention, according to the specified integral_constant
tag, or ignoring allocator
in the e_NIL_TRAITS
case. If the constructor throws, the memory at address
is left in an unspecified state.
template<class TARGET_TYPE , class ALLOCATOR >
void bslma::ConstructionUtil_Imp::destructiveMove |
( |
TARGET_TYPE * |
address, |
|
|
const ALLOCATOR & |
allocator, |
|
|
bsl::integral_constant< int, e_NIL_TRAITS > |
, |
|
|
TARGET_TYPE * |
original |
|
) |
| |
|
inlinestatic |
Create an object of (template parameter) TARGET_TYPE
at the specified address
by move construction from the specified original
object, then destroy original
. The specified allocator
is unused (except possibly in precondition checks). The constructed object will have the same allocator (if any) as original
. If the move constructor throws an exception, the memory at address
is left in an uninitialized state and original
is left in a valid but unspecified state. The behavior is undefined if original
uses an allocator other than allocator
to supply memory. Note that, if original
points to an object of a type derived from TARGET_TYPE
(i.e., a slicing move) where TARGET_TYPE
has a non-virtual
destructor, then original
will be only partially destroyed.