Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bsltf_movestate
[Package bsltf]

Provide an enumeration of move-state, including unsupported. More...

Namespaces

namespace  bsltf

Detailed Description

Outline
Purpose:
Provide an enumeration of move-state, including unsupported.
Classes:
bsltf::MoveState namespace for move-state enumeration
Description:
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.
Enumerators:
  Name          Description
  -----------   -------------------------------------------------------------
  e_NOT_MOVED   The type was not involved in a move operation.

  e_MOVED       The type was involved in a move operation.

  e_UNKNOWN     The type does not expose move-state infromation.
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
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:
  bsltf::MoveState::Enum value = bsltf::MoveState::e_MOVED;
Now, we store the address of its ASCII representation in a pointer variable, asciiValue, of type const char *:
  const char *asciiValue = bsltf::MoveState::toAscii(value);
Finally, we verify the value of asciiValue:
  assert(0 == strcmp(asciiValue, "MOVED"));