BDE 4.14.0 Production release
|
#include <bslma_constructionutil.h>
Public Types | |
enum | { e_NIL_TRAITS , e_BITWISE_MOVABLE_TRAITS , e_USES_ALLOCATOR_TRAITS , e_USES_ALLOCATOR_ARG_T_TRAITS } |
Static Public Member Functions | |
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.
anonymous enum |
These constants are used in the overloads below, when the last argument is of type bsl::integral_constant<int, N> *
, indicating that TARGET_TYPE
has the traits for which the enumerator equal to N
is named.
Enumerator | |
---|---|
e_NIL_TRAITS | |
e_BITWISE_MOVABLE_TRAITS | |
e_USES_ALLOCATOR_TRAITS | |
e_USES_ALLOCATOR_ARG_T_TRAITS |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Construct a default instance of (template parameter) TARGET_TYPE
at the specified address
, passing to the constructor 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.
|
inlinestatic |
|
inlinestatic |
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.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Move the bitwise movable object of (template parameter) TARGET_TYPE
at the specified original
address to the specified address
, eliding the call to the move constructor and destructor in favor of performing a bitwise copy. The specified allocator
argument is ignored (except possibly for precondition checks). The behavior is undefined if original
uses an allocator other than allocator
to supply memory.
|
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.
|
inlinestatic |
Return the specified address
cast as a pointer to void
, even if the (template parameter) TARGET_TYPE
is cv-qualified.