All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions

Traits to change types. More...

Classes

struct  util::with_const_as< Base, Key >
 Trait with type Base, plus the constantness as in Key. More...
 
struct  util::strip_referenceness_type< T >
 Trait with type T stripped of all known reference types. More...
 
struct  util::reference_addresser
 Functor applying the proper referenced_address() function. More...
 
struct  util::lvalue_reference_into_wrapper_type< T >
 Trait with type T into std::reference_wrapper if reference. More...
 

Typedefs

template<typename Base , typename Key >
using util::with_const_as_t = typename with_const_as< Base, Key >::type
 The type Base, plus the constantness as in Key. More...
 
template<typename T >
using util::strip_referenceness_t = typename strip_referenceness_type< T >::type
 The type T stripped of all known reference types. More...
 
template<typename T >
using util::lvalue_reference_into_wrapper_t = typename lvalue_reference_into_wrapper_type< T >::type
 The type T stripped of all known reference types. More...
 

Functions

template<typename Ref >
auto util::referenced_address (Ref &&ref)
 Returns the address of the referenced object. More...
 
template<typename T >
auto util::lvalue_reference_into_wrapper (T &&obj)
 Converts a l-value reference object into a std::reference_wrapper. More...
 

Detailed Description

Traits to change types.

Typedef Documentation

template<typename T >
using util::lvalue_reference_into_wrapper_t = typedef typename lvalue_reference_into_wrapper_type<T>::type

The type T stripped of all known reference types.

Template Parameters
Ttype to remove referenceness from
See Also
util::lvalue_reference_into_wrapper_type

Definition at line 645 of file MetaUtils.h.

template<typename T >
using util::strip_referenceness_t = typedef typename strip_referenceness_type<T>::type

The type T stripped of all known reference types.

Template Parameters
Ttype to remove referenceness from
See Also
util::strip_referenceness_type

Definition at line 574 of file MetaUtils.h.

template<typename Base , typename Key >
using util::with_const_as_t = typedef typename with_const_as<Base, Key>::type

The type Base, plus the constantness as in Key.

Template Parameters
Basethe basic type being returned
Keya type expressing the constantness wanted for Base
See Also
util::with_const_as

Definition at line 549 of file MetaUtils.h.

Function Documentation

template<typename T >
auto util::lvalue_reference_into_wrapper ( T &&  obj)

Converts a l-value reference object into a std::reference_wrapper.

Template Parameters
Ttype of the object to be converted
Parameters
objobject to be converted
Returns
either obj or a std::reference_wrapper around it
See Also
util::lvalue_reference_into_wrapper_type

This function operates on a fashion similar to util::lvalue_reference_into_wrapper_type, but it performs the conversion of an instantiated object rather than just reporting a type.

Definition at line 660 of file MetaUtils.h.

typename lvalue_reference_into_wrapper_type< T >::type lvalue_reference_into_wrapper_t
The type T stripped of all known reference types.
Definition: MetaUtils.h:645
template<typename Ref >
auto util::referenced_address ( Ref &&  ref)

Returns the address of the referenced object.

Template Parameters
Reftype of reference
Parameters
refreference
Returns
a pointer to the referenced object

This function also manages std::reference_wrapper arguments, by returning the address of the object they reference. In all other cases, the return value is simply std::addressof(obj).

Definition at line 1013 of file MetaUtils.h.

1014  { return details::referenced_address_impl<Ref>::addressof(ref); }