[#BloombergLP-bslmf-ForwardingRefTypeUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmf.adoc[bslmf]::ForwardingRefTypeUtil :relfileprefix: ../../ :mrdocs: Provide a namespace for the `forwardToTarget` function. == Synopsis Declared in `<bslmf_forwardingreftype.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> class ForwardingRefTypeUtil; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmf/ForwardingRefTypeUtil/TargetType.adoc[`TargetType`] | The closest type used to "reconstitute" `t_TYPE` from `ForwardingRefType<t_TYPE>::Type`. This type may differ from `t_TYPE` through the addition of a reference. |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmf/ForwardingRefTypeUtil/forwardToTarget.adoc[`forwardToTarget`] | Return (for the specified `v` parameter) `std::forward<t_TYPE>(v)`, where `v` is assumed to originally have been an argument of `t_TYPE` after forwarding through an intermediate call chain. Specifically, if `t_TYPE` is an rvalue type, return an rvalue reference to `v`, otherwise return `v` unchanged, thus converting an rvalue copy into an rvalue move when possible. For compilers that do not support rvalue references, return `v` unchanged. This function is intended to be called to forward an argument to the final target function of a forwarding call chain. Note that this function is not intended for use with `t_TYPE` parameters of `volatile`‐qualified rvalue type, which are effectively unheard of in real code and have strange and hard‐to‐understand rules. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#