Non‐allocating integer wrapper that tracks copy and move operations.
Synopsis
Declared in <bsltf_argumenttype.h>
template<int N>
class ArgumentType;
Description
This class template wraps an integer value and provides implicit conversion to, and explicit conversion from, int, while keeping track of copy and move operations. Its main purpose is for following an argument through a forwarding interface in test drivers. Each value of the template parameter N yields a unique type, enabling a test driver to distingusih them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of test‐class methods and constructors or in calls to methods and constructors of a class template under test. When an object of this type is copied or moved (via construction or assignment), the value returned by the copyMoveState accessor (the copy/move state), is updated for the target object and, in the case of a move, for the source object as well.
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assignment operators |
|
Return the copy/move state of this object. |
|
Return whether this object was the source of a move operation. |
|
Return whether this object was the target of a move operation. |
|
Set this object to the default‐constructed state. |
|
Set this object's value and copy/move state. |
|
Return the value of this object. |
Friends
Name |
Description |
Return the copy/move state of the specified |
Non-Member Functions
Name |
Description |
Print the specified |
Derived Classes
Name |
Description |
Pass‐by‐value wrapper that avoids a C++03 conversion ambiguity. |
Created with MrDocs