Allocating test type that records when move semantics are used.

Synopsis

Declared in <bsltf_movablealloctesttype.h>

class MovableAllocTestType;

Description

This class provides an unconstrained (value‐semantic) attribute type that records when move semantics have been invoked with the object instance as the source parameter. The class uses a bslma::Allocator to allocate memory and defines the type trait bslma::UsesBslmaAllocator. This class is primarily provided to facilitate testing of templates where move semantics need to be differentiated versus copy semantics. See the Attributes section under DESCRIPTION in the component‐level documentation for information on the class attributes.

Member Functions

Name

Description

MovableAllocTestType [constructor]

Constructors

~MovableAllocTestType [destructor]

Destroy this object.

operator=

Assignment operators

allocator

Return the allocator used by this object to supply memory.

copyMoveState

Return the copy/move state of this object.

data

Return the value of the data attribute of this object.

movedFrom

Return the move state of this object as source of a move operation.

movedInto

Return the move state of this object as target of a move operation.

setCopyMoveState

Set the copy/move state of this object to the specified state.

setData

Set the data attribute of this object to the specified value.

setMovedInto

Set the moved‐into state of this object to the specified value.

Friends

Name

Description

BloombergLP::bsltf::setCopyMoveState

Set the copy/move state of the object at the specified obj address.

BloombergLP::bsltf::copyMoveState

Return the copy/move state of the specified obj.

Non-Member Functions

Name

Description

debugprint

Same as the preceding overload for this test type.

operator!=

Return true if the specified lhs and rhs do not have the same value.

operator==

Return true if the specified lhs and rhs have the same value.

Created with MrDocs