...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::proto::functional::first —
A PolymorphicFunctionObject type that returns
the first element of a std::pair<>
.
// In header: <boost/proto/functional/std/utility.hpp> struct first : proto::callable { // member classes/structs/unions template<typename This, typename Pair> struct result<This(Pair)> { // types typedef typename Pair::first_type type; }; template<typename This, typename Pair> struct result<This(Pair &)> { // types typedef typename Pair::first_type & type; }; template<typename This, typename Pair> struct result<This(Pair const &)> { // types typedef typename Pair::first_type const & type; }; // public member functions template<typename Pair> typename Pair::first_type & operator()(Pair &) const; template<typename Pair> typename Pair::first_type const & operator()(Pair const &) const; };