LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::details::PointerVectorMaker< Coll, typename > Struct Template Reference

#include "SortByPointers.h"

Static Public Member Functions

static auto make (Coll &coll)
 

Detailed Description

template<typename Coll, typename = void>
struct util::details::PointerVectorMaker< Coll, typename >

Definition at line 122 of file SortByPointers.h.

Member Function Documentation

template<typename Coll , typename = void>
static auto util::details::PointerVectorMaker< Coll, typename >::make ( Coll &  coll)
inlinestatic

Definition at line 124 of file SortByPointers.h.

References util::begin(), util::end(), and n.

Referenced by util::makePointerVector().

125  {
126 
127  using std::begin, std::end;
128 
129  using pointer_type = decltype(&*begin(coll));
130  using ptr_coll_t = std::vector<pointer_type>;
131 
132  auto const n = coll.size();
133 
134  //
135  // create the collection of pointers to data
136  //
137  ptr_coll_t ptrs;
138  ptrs.reserve(n);
139  std::transform(
140  begin(coll), end(coll), std::back_inserter(ptrs), [](auto& obj) { return &obj; });
141 
142  return ptrs;
143 
144  } // make()
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
Char_t n[5]
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69

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