Quick Links: |
#include <bsltf_argumenttype.h>
Public Member Functions | |
ArgumentType () | |
ArgumentType (int value) | |
ArgumentType (const ArgumentType &original) | |
ArgumentType (BloombergLP::bslmf::MovableRef< ArgumentType > original) | |
~ArgumentType () | |
ArgumentType & | operator= (const ArgumentType &rhs) |
ArgumentType & | operator= (BloombergLP::bslmf::MovableRef< ArgumentType > rhs) |
operator int () const | |
MoveState::Enum | movedFrom () const |
MoveState::Enum | movedInto () const |
This class template declares a separate type for each template parameter value N
, bsltf::ArgumentType<N>
, that wraps an integer value and provides implicit conversion to and from int
. Its main purpose is that having separate types for testing enables distinguishing them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of in-place constructors.
See Component bsltf_argumenttype
bsltf::ArgumentType< N >::ArgumentType | ( | ) |
Create an ArgumentType
object having the default attribute value -1
.
bsltf::ArgumentType< N >::ArgumentType | ( | int | value | ) | [explicit] |
Create an ArgumentType
object having the specified value
. The behavior is undefined unless value >= 0
.
bsltf::ArgumentType< N >::ArgumentType | ( | const ArgumentType< N > & | original | ) |
Create an ArgumentType
object having the same value as the specified original
.
bsltf::ArgumentType< N >::ArgumentType | ( | BloombergLP::bslmf::MovableRef< ArgumentType< N > > | original | ) |
Create an ArgumentType
object having the same value as the specified original
. Note that original
is left in a valid but unspecified state.
bsltf::ArgumentType< N >::~ArgumentType | ( | ) |
Destroy this object.
ArgumentType& bsltf::ArgumentType< N >::operator= | ( | const ArgumentType< N > & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
ArgumentType& bsltf::ArgumentType< N >::operator= | ( | BloombergLP::bslmf::MovableRef< ArgumentType< N > > | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object. Note that rhs
is left in a valid but unspecified state.
bsltf::ArgumentType< N >::operator int | ( | ) | const |
Return the value of this object.
MoveState::Enum bsltf::ArgumentType< N >::movedFrom | ( | ) | const |
Return the move state of this object as source of a move operation.
MoveState::Enum bsltf::ArgumentType< N >::movedInto | ( | ) | const |
Return the move state of this object as target of a move operation.