Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Struct second

boost::proto::functional::second — A PolymorphicFunctionObject type that returns the second element of a std::pair<>.

Synopsis

// In header: <boost/proto/functional/std/utility.hpp>


struct second :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename Pair> 
  struct result<This(Pair)> {
    // types
    typedef typename Pair::second_type type;
  };
  template<typename This, typename Pair> 
  struct result<This(Pair &)> {
    // types
    typedef typename Pair::second_type & type;
  };
  template<typename This, typename Pair> 
  struct result<This(Pair const &)> {
    // types
    typedef typename Pair::second_type const & type;
  };

  // public member functions
  template<typename Pair> 
    typename Pair::second_type & operator()(Pair &) const;
  template<typename Pair> 
    typename Pair::second_type const & operator()(Pair const &) const;
};

Description

A PolymorphicFunctionObject type that returns the second element of a std::pair<>.

second public member functions

  1. template<typename Pair> 
      typename Pair::second_type & operator()(Pair & pair) const;

    Returns:

    pair.second

  2. template<typename Pair> 
      typename Pair::second_type const & operator()(Pair const & pair) const;

    Returns:

    pair.second


PrevUpHomeNext