Share via


<utility>

<utility>

namespace std {
//      TEMPLATE CLASSES
template<class T, class U>
    struct pair;
//      TEMPLATE FUNCTIONS
template<class T, class U>
    pair<T, U> make_pair(const T& x, const U& y);
template<class T, class U>
    bool operator==(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator!=(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator<(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator>(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator<=(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator>=(const pair<T, U>& x, const pair<T, U>& y);
namespace rel_ops {
    template<class T>
        bool operator!=(const T& x, const T& y);
    template<class T>
        bool operator<=(const T& x, const T& y);
    template<class T>
        bool operator>(const T& x, const T& y);
    template<class T>
        bool operator>=(const T& x, const T& y);
        };
    };

Include the STL standard header <utility> to define several templates of general use throughout the Standard Template Library.

Four template operators -- operator!=, operator<=, operator>, and operator>= -- define a total ordering on pairs of operands of the same type, given definitions of operator== and operator<.

If an implementation supports namespaces, these template operators are defined in the rel_ops namespace, nested within the std namespace. If you wish to use these template operators, write the declaration:

using namespace std::rel_ops;

which promotes the template operators into the current namespace.