Static Public Member Functions | List of all members
util::details::PointerVectorMaker < Coll, std::enable_if_t< util::is_unique_ptr_v< typename Coll::value_type > > > Struct Template Reference

#include <SortByPointers.h>

Static Public Member Functions

static auto make (Coll &coll)
 

Detailed Description

template<typename Coll>
struct util::details::PointerVectorMaker < Coll, std::enable_if_t< util::is_unique_ptr_v< typename Coll::value_type > > >

Definition at line 154 of file SortByPointers.h.

Member Function Documentation

template<typename Coll >
static auto util::details::PointerVectorMaker < Coll, std::enable_if_t< util::is_unique_ptr_v< typename Coll::value_type > > >::make ( Coll &  coll)
inlinestatic

Definition at line 159 of file SortByPointers.h.

159  {
160 
161 
162  using coll_t = Coll;
163  using unique_ptr_t = typename coll_t::value_type;
164  using value_type = typename unique_ptr_t::element_type;
165  using pointer_type = std::add_pointer_t<value_type>;
166  using ptr_coll_t = std::vector<pointer_type>;
167 
168  static_assert(util::is_unique_ptr_v<unique_ptr_t>); // kind of silly now
169 
170  using std::size;
171  auto const n = size(coll);
172 
173  //
174  // create the collection of pointers to data
175  //
176  ptr_coll_t ptrs;
177  ptrs.reserve(n);
178  std::transform(coll.begin(), coll.end(), std::back_inserter(ptrs),
179  [](auto& obj){ return obj.get(); });
180 
181  return ptrs;
182 
183  } // make()
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::void_t< T > n

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