|
BDE 4.39.x Production Release
|
#include <bsltf_allocargumenttype.h>
This class template declares a separate type for each template parameter value N, bsltf::AllocArgumentType<N>, that wraps an integer value and provides implicit conversion to and from int. The wrapped integer will be dynamically allocated using the supplied allocator, or the default allocator if none is supplied. Its main purpose is that having separate types for testing enables distinguishing them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of in-place constructors. It further tests that allocators are propagated correctly, or not, as required.
Public Member Functions | |
| AllocArgumentType (bslma::Allocator *basicAllocator=0) | |
| AllocArgumentType (int value, bslma::Allocator *basicAllocator=0) | |
| AllocArgumentType (const AllocArgumentType &original, bslma::Allocator *basicAllocator=0) | |
| AllocArgumentType (bslmf::MovableRef< AllocArgumentType > original) | |
| AllocArgumentType (bslmf::MovableRef< AllocArgumentType > original, bslma::Allocator *basicAllocator) | |
| ~AllocArgumentType () | |
| AllocArgumentType & | operator= (const AllocArgumentType &rhs) |
| AllocArgumentType & | operator= (BloombergLP::bslmf::MovableRef< AllocArgumentType > rhs) |
| bslma::Allocator * | allocator () const |
| operator int () const | |
| MoveState::Enum | movedInto () const |
| MoveState::Enum | movedFrom () const |
|
inlineexplicit |
Create an AllocArgumentType object having the (default) attribute value -1. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note, that default constructor does not allocate memory.
|
inlineexplicit |
Create an AllocArgumentType object having the specified value. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
value >= 0.
|
inline |
Create an AllocArgumentType object having the same value as the specified original. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note, that no memory is allocated if original refers to a default-constructed object.
|
inline |
Create an AllocArgumentType object having the same value as the specified original. Note, that no memory is allocated if original refers to a default-constructed object.
|
inline |
Create an AllocArgumentType object having the same value as the specified original using the specified basicAllocator to supply memory. Note, that no memory is allocated if original refers to a default-constructed object.
|
inline |
Destroy this object.
|
inline |
Return the allocator used by this object to supply memory.
|
inline |
Return the move state of this object as source of a move operation.
|
inline |
Return the move state of this object as target of a move operation.
|
inline |
Return the value of this test argument object.
|
inline |
Assign to this object the value of the specified rhs object.
rhs is left in a valid but unspecified state.
|
inline |
Assign to this object the value of the specified rhs object.