#ifndef ORIGIN_GRAPH_UTILITY_ORDERED_PAIR_HPP #define ORIGIN_GRAPH_UTILITY_ORDERED_PAIR_HPP namespace origin { namespace graphs { /** * The ordered pair template is essentially a homogenous container of two * values. This is essentially the same as std::pair, although this * class provides a slightly different interface. */ template class ordered_pair { public: typedef T value_type; ordered_pair(); ordered_pair(ordered_pair const& x); ordered_pair(T const& f, T const& s); T const& first() const; T const& second() const; private: std::pair _pair; }; template ordered_pair::ordered_pair() : _pair() { } template ordered_pair::ordered_pair(ordered_pair const& x) : _pair(x._pair) { } template ordered_pair::ordered_pair(T const& f, T const& s) : _pair(f, s) { } template T const& ordered_pair::first() const { return _pair.first; } template T const& ordered_pair::second() const { return _pair.second; } /** * Make an ordered pair over the two values. */ template ordered_pair make_ordered_pair(T const& f, T const& s) { ordered_pair x(f, s); return x; } } /* namespace graphs */ } /* namespace boost */ #endif