BloombergLP::bslalg::NothrowMovableWrapper

An object of this type wraps a value of the specified TYPE, and provides no other functionality other than returning the wrapped object. The move constructor is guaranteed not to throw, even if the move constructor for TYPE has no such guarantee. The user is thus asserting that the move constructor for the wrapped object will not throw, even if it is allowed to. Constraints: this class can be instantiated on object types only, i.e., not references, arrays, or function types (though function pointers are OK).

Synopsis

Declared in <bslalg_nothrowmovablewrapper.h>

template<class TYPE>
class NothrowMovableWrapper;

Type Aliases

NameDescription
ValueType Alias for the wrapped TYPE.
allocator_type Type of allocator to use. If TYPE is not allocator-aware, then this is a private dummy type that will disable use of any constructor that takes an allocator.

Member Functions

NameDescription
NothrowMovableWrapper [constructor]Constructors
~NothrowMovableWrapper [destructor]Destroy this object, invoking TYPEs destructor.
get_allocator Return the allocator used to construct this object. Note that this method will fail to instantiate unless TYPE is allocator-aware.
unwrap unwrap overloads
operator BloombergLP::bslmf::NestedTraitDeclaration<NothrowMovableWrapper, IsBitwiseMoveable, bslmf::IsBitwiseMoveable<TYPE>::value> Declare NothrowMovableWrapper as bitwise moveable when TYPE is.
operator BloombergLP::bslmf::NestedTraitDeclaration<NothrowMovableWrapper, UsesAllocatorArgT, bslma::UsesBslmaAllocator<TYPE>::value> Declare that NothrowMovableWrapper uses the leading-allocator convention when TYPE is allocator-aware.
operator BloombergLP::bslmf::NestedTraitDeclaration<NothrowMovableWrapper, UsesBslmaAllocator, bslma::UsesBslmaAllocator<TYPE>::value> Declare whether NothrowMovableWrapper uses a bslma allocator.
operator BloombergLP::bslmf::NestedTraitDeclaration<NothrowMovableWrapper, is_nothrow_move_constructible> Declare that NothrowMovableWrapper is nothrow move constructible.
operator ValueType& Return a reference offering modifiable access to the wrapped object.
operator ValueType const& Return a reference offering const access to the wrapped object.

Specializations

NameDescription
NothrowMovableWrapper<NothrowMovableWrapper<TYPE>> This specialization is for wrapped types. We do not support wrapping a wrapped type.
NothrowMovableWrapper<NothrowMovableWrapper<TYPE> const> This specialization is for wrapped types. We do not support wrapping a wrapped type.