[#BloombergLP-bsltf-MoveOnlyAllocTestType] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::MoveOnlyAllocTestType :relfileprefix: ../../ :mrdocs: This unconstrained (value‐semantic) attribute class that uses a `bslma::Allocator` to supply memory and defines the type trait `bslma::UsesBslmaAllocator`. This class is primarily provided to facilitate testing of templates by defining a simple type representative of user‐defined types having an allocator. See the Attributes section under DESCRIPTION in the component‐level documentation for information on the class attributes. == Synopsis Declared in `<bsltf_moveonlyalloctesttype.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class MoveOnlyAllocTestType; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/2constructor-03.adoc[`MoveOnlyAllocTestType`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/2destructor.adoc[`~MoveOnlyAllocTestType`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/operator_assign.adoc[`operator=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. If `rhs` is a reference to this object, there are no other effects; otherwise, the object referenced by `rhs` will be reset to a default constructed state, `rhs` shall be in a `movedFrom` state, and this object will be in a `movedTo` state. No allocations shall occur (so no exception will be thrown) unless this object and `rhs` have different allocators. Note that the moved‐from state is specified, rather than "valid but unspecified", as this type is intended for verifying test drivers that want to ensure that moves occur correctly where expected. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/allocator.adoc[`allocator`] | Return the allocator used by this object to supply memory. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/data.adoc[`data`] | Return the value of the `data` attribute of this object. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/movedFrom.adoc[`movedFrom`] | Return the move state of this object as source of a move operation. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/movedInto.adoc[`movedInto`] | Return the move state of this object as target of a move operation. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/setData.adoc[`setData`] | Set the `data` attribute of this object to the specified `value`. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType/setMovedInto.adoc[`setMovedInto`] | Set the moved‐into state of this object to the specified `value`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsltf/debugprint-0d4.adoc[`debugprint`] | Same as the preceding overload for this test type. | xref:BloombergLP/bsltf/getMovedFrom-05.adoc[`getMovedFrom`] | Return the move‐from state of the specified `object`. | xref:BloombergLP/bsltf/getMovedInto-0f.adoc[`getMovedInto`] | Return the move‐into state of the specified `object`. | xref:BloombergLP/bsltf/operator_not_eq-02d.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise. Two `MoveOnlyAllocTestType` objects do not have the same value if their `data` attributes are not the same. | xref:BloombergLP/bsltf/operator_eq-0f1.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise. Two `MoveOnlyAllocTestType` objects have the same if their `data` attributes are the same. | xref:BloombergLP/bsltf/setMovedInto-04.adoc[`setMovedInto`] | Set the moved‐into state of the specified `object` to the specified `value`. | xref:BloombergLP/bsltf/swap-06.adoc[`swap`] | Exchange the states of the specified `a` and `b`. Both `a` and `b` will be left in a moved‐into state. No allocations shall occur (so no exceptions will be thrown) unless `a` and `b` have different allocators. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#