BDE 4.39.x 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 >

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

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 ()
 
ArgumentTypeoperator= (ArgumentType &rhs)
 
ArgumentTypeoperator= (ArgumentType const &rhs)
 
ArgumentTypeoperator= (bslmf::MovableRef< ArgumentType > rhs)
 
ArgumentTypeoperator= (int rhs)
 
void reset ()
 
void set (int value, CopyMoveState::Enum state)
 
 operator int () const
 
CopyMoveState::Enum copyMoveState () const
 
MoveState::Enum movedFrom () const
 
MoveState::Enum movedInto () const
 

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

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

◆ 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

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