[#BloombergLP-bsltf-WellBehavedMoveOnlyAllocTestType]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::WellBehavedMoveOnlyAllocTestType
:relfileprefix: ../../
:mrdocs:

This unconstrained (value&hyphen;semantic) attribute class that uses a `bslma&colon;&colon;Allocator` to supply memory and defines the type trait `bslma&colon;&colon;UsesBslmaAllocator`&period; This class is primarily provided to facilitate testing of templates by defining a simple type representative of user&hyphen;defined types having an allocator&period; See the  section for information on the class attributes&period;

== Synopsis

Declared in `&lt;bsltf&lowbar;wellbehavedmoveonlyalloctesttype&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class WellBehavedMoveOnlyAllocTestType;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/2constructor-02.adoc[`WellBehavedMoveOnlyAllocTestType`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/2destructor.adoc[`&#126;WellBehavedMoveOnlyAllocTestType`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; If `rhs` is a reference to this object, there are no other effects&semi; 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&period; No allocations shall occur (so no exception will be thrown) unless this object and `rhs` have different allocators&period; Note that the moved&hyphen;from state is specified, rather than &quot;valid but unspecified&quot;, as this type is intended for verifying test drivers that want to ensure that moves occur correctly where expected&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/data.adoc[`data`] 
| Return the value of the `data` attribute of this object&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/movedFrom.adoc[`movedFrom`] 
| Return the move state of this object as source of a move operation&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/movedInto.adoc[`movedInto`] 
| Return the move state of this object as target of a move operation&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/setData.adoc[`setData`] 
| Set the `data` attribute of this object to the specified `value`&period;
| xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType/setMovedInto.adoc[`setMovedInto`] 
| Set the moved&hyphen;into state of this object to the specified `value`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/debugprint-01d.adoc[`debugprint`]
| Same as the preceding overload for this test type&period;
| xref:BloombergLP/bsltf/getMovedFrom-04.adoc[`getMovedFrom`]
| Return the move&hyphen;from state of the specified `object`&period;
| xref:BloombergLP/bsltf/getMovedInto-08.adoc[`getMovedInto`]
| Return the move&hyphen;into state of the specified `object`&period;
| xref:BloombergLP/bsltf/operator_not_eq-05f.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period; Two `WellBehavedMoveOnlyAllocTestType` objects do not have the same value if their `data` attributes are not the same&period;
| xref:BloombergLP/bsltf/operator_eq-0b99.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `WellBehavedMoveOnlyAllocTestType` objects have the same if their `data` attributes are the same&period;
| xref:BloombergLP/bsltf/setMovedInto-09.adoc[`setMovedInto`]
| Set the moved&hyphen;into state of the specified `object` to the specified `value`&period;
| xref:BloombergLP/bsltf/swap-0f.adoc[`swap`]
| Exchange the states of the specified `a` and `b`&period; If the allocators match, both `a` and `b` will be left in a moved&hyphen;into state, otherwise, both will not&period; If `a` and `b` are the same object, this function will have no effect&period; No allocations shall occur (so no exceptions will be thrown) unless `a` and `b` have different allocators&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
