mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
35f08fe242
add string::find
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
#ifndef SPROUT_UTILITY_PAIR_COMPARISON_HPP
|
|
#define SPROUT_UTILITY_PAIR_COMPARISON_HPP
|
|
|
|
#include <sprout/config.hpp>
|
|
#include <sprout/utility/pair/pair.hpp>
|
|
|
|
namespace sprout {
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator==(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return x.first == y.first && x.second == y.second;
|
|
}
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator!=(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return !(x == y);
|
|
}
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator<(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return x.first < y.first || (!(y.first < x.first) && x.second < y.second);
|
|
}
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator>(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return y < x;
|
|
}
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator<=(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return !(y < x);
|
|
}
|
|
template<class T1, class T2>
|
|
inline SPROUT_CONSTEXPR bool
|
|
operator>=(sprout::pair<T1, T2> const& x, sprout::pair<T1, T2> const& y) {
|
|
return !(x < y);
|
|
}
|
|
} // namespace sprout
|
|
|
|
#endif // #ifndef SPROUT_UTILITY_PAIR_COMPARISON_HPP
|