BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf::ArgumentTypeByValue< N > Class Template Reference

#include <bsltf_argumenttype.h>

Inheritance diagram for bsltf::ArgumentTypeByValue< N >:
bsltf::ArgumentType< N >

Public Member Functions

 ArgumentTypeByValue (ArgumentTypeDefault=ArgumentTypeDefault())
 
 ArgumentTypeByValue (ArgumentType< N > const &original)
 
 ArgumentTypeByValue (ArgumentType< N > &original)
 
 ArgumentTypeByValue (bslmf::MovableRef< ArgumentType< N > > original)
 
- Public Member Functions inherited from bsltf::ArgumentType< N >
 ArgumentType (ArgumentTypeDefault=ArgumentTypeDefault())
 
 ArgumentType (int value)
 
 ArgumentType (ArgumentType &original)
 
 ArgumentType (ArgumentType const &original)
 
 ArgumentType (bslmf::MovableRef< ArgumentType > original)
 
 ~ArgumentType ()
 Destroy this object.
 
ArgumentTypeoperator= (ArgumentType &rhs)
 
ArgumentTypeoperator= (ArgumentType const &rhs)
 
ArgumentTypeoperator= (bslmf::MovableRef< ArgumentType > rhs)
 
ArgumentTypeoperator= (int rhs)
 
void reset ()
 
void set (int value, CopyMoveState::Enum state)
 Set this object to the default-constructed state.
 
 operator int () const
 Return the value of this object.
 
CopyMoveState::Enum copyMoveState () const
 Return the copy/move state of this object.
 
MoveState::Enum movedFrom () const
 
MoveState::Enum movedInto () const
 

Detailed Description

template<int N>
class bsltf::ArgumentTypeByValue< N >

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.

See bsltf_argumenttype

Constructor & Destructor Documentation

◆ ArgumentTypeByValue() [1/4]

template<int N>
bsltf::ArgumentTypeByValue< N >::ArgumentTypeByValue ( ArgumentTypeDefault  = ArgumentTypeDefault())
inline

◆ ArgumentTypeByValue() [2/4]

template<int N>
bsltf::ArgumentTypeByValue< N >::ArgumentTypeByValue ( ArgumentType< N > const &  original)
inline

◆ ArgumentTypeByValue() [3/4]

template<int N>
bsltf::ArgumentTypeByValue< N >::ArgumentTypeByValue ( ArgumentType< N > &  original)
inline

◆ ArgumentTypeByValue() [4/4]

template<int N>
bsltf::ArgumentTypeByValue< N >::ArgumentTypeByValue ( bslmf::MovableRef< ArgumentType< N > >  original)
inline

Initialize the ArgumentType<N> base object from the specified original.


The documentation for this class was generated from the following file: