Pass‐by‐value wrapper that avoids a C++03 conversion ambiguity.
Synopsis
Declared in <bsltf_argumenttype.h>
template<int N>
class ArgumentTypeByValue
: public ArgumentType<N>
Description
This class works around a limitation in C++03 whereby initializing a pass‐by‐value parameter of type bslmf::ArgumentType<N> from a MovableRef<bslmf::ArgumentType<N> > results in an ambiguous conversion sequence (i.e., MovableRef::operator T& vs. ArgumentType(MovableRef) are equally good conversions). Pass‐by‐value use cases (e.g., recording the value category of multiple function arguments) can use this class as a parameter type, instead, eliminating the ambiguity because MovableRef<AT> ‐> AT& ‐> ArgumentTypeByValue requires two user‐defined conversions and is therefore eliminated during overload resolution.
Base Classes
Name |
Description |
Non‐allocating integer wrapper that tracks copy and move operations. |
Member Functions
Name |
Description |
|
Constructors |
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. |
Non-Member Functions
Name |
Description |
Return the copy/move state of the specified |
|
Print the specified |
Created with MrDocs