This unconstrained (value-semantic) attribute class uses a standard allocator of (template parameter) type ALLOC to allocate memory. This class does NOT define the type trait bslma::UsesBslmaAllocator, but the trait will be true if ALLOC is convertible from bslma::Allocator * (e.g., if it is an instantiation of bsl::allocator). This class is primarily provided to facilitate testing of templates by defining a simple type representative of user-defined types using a standard allocator. See the section for information on the class attributes.
Declared in <bsltf_stdalloctesttype.h>
template<class ALLOC>
class StdAllocTestType;
| Name | Description |
|---|---|
allocator_type | Allocator type used by this test type (needed by uses_allocator). |
| Name | Description |
|---|---|
StdAllocTestType [constructor] | Constructors |
~StdAllocTestType [destructor] | Destroy this object. |
operator= | Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. |
allocator | Return the allocator used by this object to supply memory. |
data | Return the value of the data attribute of this object. |
setData | Set the data attribute of this object to the specified value. |
| Name | Description |
|---|---|
debugprint | Same as the preceding overload for this test type. |
operator!= | Return true if the specified lhs and rhs objects do not have the same value, and false otherwise. Two AllocTestType objects do not have the same value if their data attributes are not the same. |
operator== | Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two AllocTestType objects have the same if their data attributes are the same. |