|
BDE 4.14.0 Production release
|
Provide testing type that is move-only & uses bslma allocators.
This component provides a single, unconstrained (value-semantic) attribute class, MoveOnlyAllocTestType, that uses a bslma::Allocator to supply memory (defines the type trait bslma::UsesBslmaAllocator) and provides only a move constructor and assignment operator (disables copy constructor and assignment operator). Furthermore, this class is not bitwise-moveable, and will assert on destruction if it has been moved. This class is primarily provided to facilitate testing of templates by defining a simple type representative of user-defined types having an allocator that cannot be copied (only moved).
data: representation of the object's valueThis section illustrates intended use of this component.
Suppose we wanted to print the supported traits of this test type.
First, we create a function template printTypeTraits with a parameterized TYPE:
Now, we invoke the printTypeTraits function template using MoveOnlyAllocTestType as the parameterized TYPE:
Finally, we observe the console output: