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