BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslalg::NothrowMovableWrapper< TYPE > Class Template Reference

#include <bslalg_nothrowmovablewrapper.h>

Detailed Description

template<class TYPE>
class bslalg::NothrowMovableWrapper< TYPE >

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).

See bslalg_nothrowmovablewrapper

Public Types

typedef bsl::conditional< bslma::UsesBslmaAllocator< TYPE >::value, bsl::allocator< char >, DummyAllocator >::type allocator_type
 
typedef TYPE ValueType
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (NothrowMovableWrapper, bsl::is_nothrow_move_constructible)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (NothrowMovableWrapper, bslma::UsesBslmaAllocator, bslma::UsesBslmaAllocator< TYPE >::value)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (NothrowMovableWrapper, bslmf::UsesAllocatorArgT, bslma::UsesBslmaAllocator< TYPE >::value)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (NothrowMovableWrapper, bslmf::IsBitwiseMoveable, bslmf::IsBitwiseMoveable< TYPE >::value)
 
 NothrowMovableWrapper ()
 
 NothrowMovableWrapper (bsl::allocator_arg_t, const allocator_type &alloc)
 
 NothrowMovableWrapper (const TYPE &val)
 
 NothrowMovableWrapper (bsl::allocator_arg_t, const allocator_type &alloc, const TYPE &val)
 
 NothrowMovableWrapper (bslmf::MovableRef< TYPE > val)
 
 NothrowMovableWrapper (bsl::allocator_arg_t, const allocator_type &alloc, bslmf::MovableRef< TYPE > val)
 
 NothrowMovableWrapper (const NothrowMovableWrapper &original)
 
 NothrowMovableWrapper (bsl::allocator_arg_t, const allocator_type &alloc, const NothrowMovableWrapper &original)
 
 NothrowMovableWrapper (bslmf::MovableRef< NothrowMovableWrapper > original) BSLS_KEYWORD_NOEXCEPT
 
 NothrowMovableWrapper (bsl::allocator_arg_t, const allocator_type &alloc, bslmf::MovableRef< NothrowMovableWrapper > original)
 
 ~NothrowMovableWrapper ()
 
ValueTypeunwrap ()
 
 operator ValueType & ()
 
allocator_type get_allocator () const
 
ValueType const & unwrap () const
 
 operator ValueType const & () const
 

Member Typedef Documentation

◆ allocator_type

template<class TYPE >
typedef bsl::conditional<bslma::UsesBslmaAllocator<TYPE>::value,bsl::allocator<char>,DummyAllocator>::type bslalg::NothrowMovableWrapper< 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.

◆ ValueType

template<class TYPE >
typedef TYPE bslalg::NothrowMovableWrapper< TYPE >::ValueType

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::BSLMF_NESTED_TRAIT_DECLARATION ( NothrowMovableWrapper< TYPE >  ,
bsl::is_nothrow_move_constructible   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [1/3]

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( NothrowMovableWrapper< TYPE >  ,
bslma::UsesBslmaAllocator  ,
bslma::UsesBslmaAllocator< TYPE >::value   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [2/3]

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( NothrowMovableWrapper< TYPE >  ,
bslmf::IsBitwiseMoveable  ,
bslmf::IsBitwiseMoveable< TYPE >::value   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [3/3]

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( NothrowMovableWrapper< TYPE >  ,
bslmf::UsesAllocatorArgT  ,
bslma::UsesBslmaAllocator< TYPE >::value   
)

◆ operator ValueType &()

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::operator ValueType & ( )
inline

Return a reference offering modifiable access to the wrapped object.

◆ operator ValueType const &()

template<class TYPE >
bslalg::NothrowMovableWrapper< TYPE >::operator ValueType const & ( ) const
inline

Return a reference offering const access to the wrapped object.


The documentation for this class was generated from the following file: