BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmf::MovableRefUtil Struct Reference

#include <bslmf_movableref.h>

Classes

struct  AddLvalueReference
 
struct  AddMovableReference
 
struct  Decay
 
struct  IsLvalueReference
 
struct  IsMovableReference
 
struct  IsReference
 
struct  RemoveReference
 

Static Public Member Functions

template<class t_TYPE >
static t_TYPE & access (t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
static t_TYPE & access (MovableRef< t_TYPE > ref) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
static MovableRef< t_TYPE > move (t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
static MovableRef< typename bsl::remove_reference< t_TYPE >::type > move (MovableRef< t_TYPE > reference) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
static bsl::enable_if<!bsl::is_nothrow_move_constructible< t_TYPE >::value &&bsl::is_copy_constructible< t_TYPE >::value, constt_TYPE & >::type move_if_noexcept (t_TYPE &lvalue) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
static bsl::enable_if<!bsl::is_copy_constructible< t_TYPE >::value||bsl::is_nothrow_move_constructible< t_TYPE >::value, MovableRef< t_TYPE > >::type move_if_noexcept (t_TYPE &lvalue) BSLS_KEYWORD_NOEXCEPT
 

Detailed Description

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

Member Function Documentation

◆ access() [1/2]

template<class t_TYPE >
t_TYPE & bslmf::MovableRefUtil::access ( MovableRef< t_TYPE >  ref)
inlinestatic

◆ access() [2/2]

template<class t_TYPE >
t_TYPE & bslmf::MovableRefUtil::access ( t_TYPE &  ref)
inlinestatic

◆ move() [1/2]

template<class t_TYPE >
MovableRef< typename bsl::remove_reference< t_TYPE >::type > bslmf::MovableRefUtil::move ( MovableRef< t_TYPE >  reference)
inlinestatic

◆ move() [2/2]

template<class t_TYPE >
MovableRef< t_TYPE > bslmf::MovableRefUtil::move ( t_TYPE &  reference)
inlinestatic

◆ move_if_noexcept() [1/2]

template<class t_TYPE >
static bsl::enable_if<!bsl::is_nothrow_move_constructible< t_TYPE >::value &&bsl::is_copy_constructible< t_TYPE >::value, constt_TYPE & >::type bslmf::MovableRefUtil::move_if_noexcept ( t_TYPE &  lvalue)
inlinestatic

Return a const-qualified reference to the specified lvalue. This function is selected by overload resolution if the move constructor for t_TYPE might throw an exception. Constructing a t_TYPE object from the result will result in the copy constructor being invoked rather than the (unsafe) move constructor.

◆ move_if_noexcept() [2/2]

template<class t_TYPE >
static bsl::enable_if<!bsl::is_copy_constructible< t_TYPE >::value||bsl::is_nothrow_move_constructible< t_TYPE >::value, MovableRef< t_TYPE > >::type bslmf::MovableRefUtil::move_if_noexcept ( t_TYPE &  lvalue)
inlinestatic

Return a movable reference to the specified lvalue. This function is selected by overload resolution if the move constructor for t_TYPE is nothrow-move-constructible. Constructing a t_TYPE object from the result will result in the (safe) move constructor being invoked. Note that that the bsl::is_nothrow_move_constructible trait can be customized in C++03 mode to indicate that a type is nothrow-move-constructible.


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