Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Tuple Interface to std::pair.

#include <boost/tr1/utility.hpp>

or

#include <utility>

The existing class template std::pair, can also be accessed using the tuple interface.

namespace std {
namespace tr1 {

template <class T> class tuple_size; // forward declaration
template <int I, class T> class tuple_element; // forward declaration
template <class T1, class T2> struct tuple_size<std::pair<T1, T2> >;
template <class T1, class T2> struct tuple_element<0, std::pair<T2, T2> >;
template <class T1, class T2> struct tuple_element<1, std::pair<T2, T2> >;
// see below for definition of "P".
template<int I, class T1, class T2> P& get(std::pair<T1, T2>&);
template<int I, class T1, class T2> const P& get(const std::pair<T1, T2>&);

} // namespace tr1
} // namespace std

Configuration: Boost.Config should (automatically) define the macro BOOST_HAS_TR1_UTILITY if your standard library implements this part of TR1.

Standard Conformity: No known problems.


PrevUpHomeNext