Function object for retrieving the N'th element of a std::pair or std::tuple.
More...
|
template<class PairOrTuple > |
constexpr return_type
< PairOrTuple > & | operator() (PairOrTuple &p) const |
|
template<class PairOrTuple > |
constexpr const return_type
< PairOrTuple > & | operator() (const PairOrTuple &p) const |
|
template<class PairOrTuple > |
constexpr return_type
< PairOrTuple > && | operator() (PairOrTuple &&p) const |
|
template<size_t N>
class TfGet< N >
Function object for retrieving the N'th element of a std::pair or std::tuple.
This is similar to std::get<N>, but wrapped up in a function object suitable for use with STL algorithms.
Example:
* const std::vector<std::pair<int, std::string>> pairs = { ... }
* std::vector<int> intsOnly(pairs.size());
* std::transform(pairs.begin(), pairs.end(), intsOnly.begin(),
TfGet<0>());
*
Definition at line 391 of file stl.h.