20 General utilities library [utilities]

20.6 Optional objects [optional]

20.6.8 Comparison with T [optional.comp_with_t]

template <class T> constexpr bool operator==(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x == v : false;

template <class T> constexpr bool operator==(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v == *x : false;

template <class T> constexpr bool operator!=(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x != v : true;

template <class T> constexpr bool operator!=(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v != *x : true;

template <class T> constexpr bool operator<(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x < v : true;

template <class T> constexpr bool operator<(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v < *x : false;

template <class T> constexpr bool operator<=(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x <= v : true;

template <class T> constexpr bool operator<=(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v <= *x : false;

template <class T> constexpr bool operator>(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x > v : false;

template <class T> constexpr bool operator>(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v > *x : true;

template <class T> constexpr bool operator>=(const optional<T>& x, const T& v);

Effects: Equivalent to: return bool(x) ? *x >= v : false;

template <class T> constexpr bool operator>=(const T& v, const optional<T>& x);

Effects: Equivalent to: return bool(x) ? v >= *x : true;