1 // Copyright 2020 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_RANGES_FUNCTIONAL_H_ 6 #define BASE_RANGES_FUNCTIONAL_H_ 7 8 #include <functional> 9 #include <type_traits> 10 #include <utility> 11 12 namespace base { 13 14 namespace ranges { 15 16 // Simplified implementations of C++20's std::ranges comparison function 17 // objects. As opposed to the std::ranges implementation, these versions do not 18 // constrain the passed-in types. 19 // 20 // Reference: https://wg21.link/range.cmp 21 using equal_to = std::equal_to<>; 22 using not_equal_to = std::not_equal_to<>; 23 using greater = std::greater<>; 24 using less = std::less<>; 25 using greater_equal = std::greater_equal<>; 26 using less_equal = std::less_equal<>; 27 28 } // namespace ranges 29 30 } // namespace base 31 32 #endif // BASE_RANGES_FUNCTIONAL_H_ 33