[#BloombergLP-bsltf-ArgumentTypeByValue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::ArgumentTypeByValue
:relfileprefix: ../../
:mrdocs:

Pass&hyphen;by&hyphen;value wrapper that avoids a C&plus;&plus;03 conversion ambiguity&period;

== Synopsis

Declared in `&lt;bsltf&lowbar;argumenttype&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int N&gt;
class ArgumentTypeByValue
    : public xref:BloombergLP/bsltf/ArgumentType.adoc[ArgumentType&lt;N&gt;]
----

== Description

This class works around a limitation in C&plus;&plus;03 whereby initializing a pass&hyphen;by&hyphen;value parameter of type `bslmf&colon;&colon;ArgumentType&lt;N&gt;` from a `MovableRef&lt;bslmf&colon;&colon;ArgumentType&lt;N&gt; &gt;` results in an ambiguous conversion sequence (i&period;e&period;, `MovableRef&colon;&colon;operator T&amp;` vs&period; `ArgumentType(MovableRef)` are equally good conversions)&period; Pass&hyphen;by&hyphen;value use cases (e&period;g&period;, recording the value category of multiple function arguments) can use this class as a parameter type, instead, eliminating the ambiguity because `MovableRef&lt;AT&gt;` &hyphen;&gt; `AT&amp;` &hyphen;&gt; `ArgumentTypeByValue` requires _two_ user&hyphen;defined conversions and is therefore eliminated during overload resolution&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bsltf/ArgumentType.adoc[ArgumentType&lt;N&gt;]`
| Non&hyphen;allocating integer wrapper that tracks copy and move operations&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/ArgumentTypeByValue/2constructor-07.adoc[`ArgumentTypeByValue`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bsltf/ArgumentType/operator_assign-09.adoc[`operator&equals;`] 
| Assignment operators
| xref:BloombergLP/bsltf/ArgumentType/copyMoveState.adoc[`copyMoveState`] 
| Return the copy&sol;move state of this object&period;
| xref:BloombergLP/bsltf/ArgumentType/movedFrom.adoc[`movedFrom`] 
| Return whether this object was the source of a move operation&period;
| xref:BloombergLP/bsltf/ArgumentType/movedInto.adoc[`movedInto`] 
| Return whether this object was the target of a move operation&period;
| xref:BloombergLP/bsltf/ArgumentType/reset.adoc[`reset`] 
| Set this object to the default&hyphen;constructed state&period;
| xref:BloombergLP/bsltf/ArgumentType/set.adoc[`set`] 
| Set this object&apos;s value and copy&sol;move state&period;
| xref:BloombergLP/bsltf/ArgumentType/2conversion.adoc[`operator int`] 
| Return the value of this object&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/copyMoveState-05.adoc[`copyMoveState`]
| Return the copy&sol;move state of the specified `obj`&period;
| xref:BloombergLP/bsltf/debugprint-01f.adoc[`debugprint`]
| Print the specified `object` as a string&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
