All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
util::reference_addresser Struct Reference

Functor applying the proper referenced_address() function. More...

#include <MetaUtils.h>

Public Member Functions

template<typename Ref >
decltype(auto) operator() (Ref &&ref) const
 

Static Public Member Functions

template<typename Ref >
static decltype(auto) addressof (Ref &&ref)
 

Detailed Description

Functor applying the proper referenced_address() function.

See Also
referenced_address()

This class operates in the same way as util::referenced_address(), but it is easier to use in STL algorithms since it's not a template:

std::vector<int> data(4U, 0);
std::vector<int const*> dataPtr;
std::transform(data.cbegin(), data.cend(), std::back_inserter(dataPtr),

will fill dataPtr with the pointers to the elements in data. This is easier than taking the address of the correct template instance of util::referenced_address(), or than writing a lambda function for that.

Definition at line 609 of file MetaUtils.h.

Member Function Documentation

template<typename Ref >
static decltype(auto) util::reference_addresser::addressof ( Ref &&  ref)
inlinestatic

Definition at line 615 of file MetaUtils.h.

616  { return referenced_address(std::forward<Ref>(ref)); }
auto referenced_address(Ref &&ref)
Returns the address of the referenced object.
Definition: MetaUtils.h:1013
template<typename Ref >
decltype(auto) util::reference_addresser::operator() ( Ref &&  ref) const
inline

Definition at line 611 of file MetaUtils.h.

612  { return addressof(std::forward<Ref>(ref)); }
static decltype(auto) addressof(Ref &&ref)
Definition: MetaUtils.h:615

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