BloombergLP::bslmf::MovableRefUtil

This struct provides a collection of utility functions operating on objects of type MovableRef<t_TYPE>. The primary use of these utilities is to create a consistent notation for using the C++03 MovableRef<t_TYPE> objects and the C++11 t_TYPE&& r-value references.

Synopsis

Declared in <bslmf_movableref.h>

struct MovableRefUtil;

Types

NameDescription
AddLvalueReference This struct template provides a metafunction that defines a nested type typedef that is an lvalue reference to t_TYPE. If t_TYPE is already an lvalue reference, then type is t_TYPE. Otherwise, if t_TYPE is MovableRef<T2>, then type is T2&. This transformation reflects the semantics of reference collapsing in section [dec.ref]of the standard.
AddMovableReference This struct template provides a metafunction that defines a nested type typedef that, if t_TYPE is not a reference type, is MovableRef<t_TYPE>. Otherwise, if t_TYPE is a specialization of MovableRef, type is the same as t_TYPE. Otherwise, type is t_TYPE&. This transformation reflects the semantics of reference collapsing in section [dec.ref]of the standard.
Decay This struct template provides a metafunction that defines a nested type typedef that applies lvalue-to-rvalue, array-to-pointer, and function-to-pointer conversions that occur when an lvalue of type t_TYPE is used as an rvalue, and also removes const, volatile, and reference qualifiers from class types in order to model by-value argument passing. For the purpose of this type trait, MovableRef<T> is considered a (movable) reference-qualified T.
IsLvalueReference This struct template provides a Boolean metafunction that inherits from bsl::true_type if the specified t_TYPE is an lvalue reference, and inherits from bsl::false_type otherwise.
IsMovableReference This struct template provides a Boolean metafunction that inherits from bsl::true_type if the specified t_TYPE is a specialization of MovableRef, and inherits from bsl::false_type otherwise.
IsReference This struct template provides a Boolean metafunction that inherits from bsl::true_type if the specified t_TYPE is either an lvalue reference or a specialization of MovableRef, and inherits from bsl::false_type otherwise.
RemoveReference This struct template provides a metafunction that, if the specified t_TYPE is a reference type, defines a nested type typedef of the type to which t_TYPE refers, and defines a nested type typedef of t_TYPE otherwise.

Static Member Functions

NameDescription
access Return an lvalue reference to the object referenced by the specified ref object.
move Return a movable reference to the specified object.
move_if_noexcept move_if_noexcept overloads