LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 572 of file MetaUtils.h.

Member Function Documentation

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

Definition at line 580 of file MetaUtils.h.

References util::referenced_address().

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

Definition at line 574 of file MetaUtils.h.

575  {
576  return addressof(std::forward<Ref>(ref));
577  }
static decltype(auto) addressof(Ref &&ref)
Definition: MetaUtils.h:580

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