BDE 4.14.0 Production release
|
Provide an enumeration of move-state, including unsupported.
This component provides a struct
, bsltf_MoveState
, which serves as a namespace for enumerating the move-state of an object, including an unknown value indicating that the test type does not support tracking of this information. An object is involved in a move operation if that object was either the source or target of a move construction or move assignment. It's up to the test type to support moved-into or moved-from or both using separate instances of this enum.
When converted to bool
, e_NOT_MOVED
yields false
whereas the rest yield true
. When e_UNKNOWN
is not expected, this conversion makes it easy to check a value for the binary copied/not-copied attribute.
This section illustrates intended use of this component.
The following snippets of code provide a simple illustration of using bsltf::MoveState
.
First, we create a variable value
of type bsltf::MoveState::Enum
and initialize it with the enumerator value bsltf::MoveState::e_MOVED
:
Now, we store the address of its ASCII representation in a pointer variable, asciiValue
, of type const char *
:
Finally, we verify the value of asciiValue
: