|
BDE 4.14.0 Production release
|
#include <bsltf_allocargumenttype.h>
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 () | |
| Destroy this object. | |
| AllocArgumentType & | operator= (const AllocArgumentType &rhs) |
Assign to this object the value of the specified rhs object. | |
| AllocArgumentType & | operator= (BloombergLP::bslmf::MovableRef< AllocArgumentType > rhs) |
| bslma::Allocator * | allocator () const |
| Return the allocator used by this object to supply memory. | |
| operator int () const | |
| Return the value of this test argument object. | |
| MoveState::Enum | movedInto () const |
| Return the move state of this object as target of a move operation. | |
| MoveState::Enum | movedFrom () const |
| Return the move state of this object as source of a move operation. | |
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.
|
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. The behavior is undefined unless 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 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assign to this object the value of the specified rhs object. Note that rhs is left in a valid but unspecified state.
|
inline |