| 1 | #ifndef BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP |
| 2 | #define BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP |
| 3 | /////////////////////////////////////////////////////////////////////////////// |
| 4 | // |
| 5 | // (C) Copyright Ion Gaztanaga 2017-2021. Distributed under the Boost |
| 6 | // Software License, Version 1.0. (See accompanying file |
| 7 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 8 | // |
| 9 | // See http://www.boost.org/libs/intrusive for documentation. |
| 10 | // |
| 11 | /////////////////////////////////////////////////////////////////////////////// |
| 12 | |
| 13 | #ifndef BOOST_CONFIG_HPP |
| 14 | # include <boost/config.hpp> |
| 15 | #endif |
| 16 | |
| 17 | #if defined(BOOST_HAS_PRAGMA_ONCE) |
| 18 | # pragma once |
| 19 | #endif |
| 20 | |
| 21 | #include <cstddef> |
| 22 | |
| 23 | namespace boost { |
| 24 | namespace intrusive { |
| 25 | |
| 26 | //Functors for member algorithm defaults |
| 27 | template<class ValueType> |
| 28 | struct value_less |
| 29 | { |
| 30 | bool operator()(const ValueType &a, const ValueType &b) const |
| 31 | { return a < b; } |
| 32 | }; |
| 33 | |
| 34 | //Functors for member algorithm defaults |
| 35 | template<class T> |
| 36 | struct value_less<T*> |
| 37 | { |
| 38 | bool operator()(const T *a, const T* b) const |
| 39 | { return std::size_t(a) < std::size_t(b); } |
| 40 | }; |
| 41 | |
| 42 | template<class ValueType> |
| 43 | struct value_equal |
| 44 | { |
| 45 | bool operator()(const ValueType &a, const ValueType &b) const |
| 46 | { return a == b; } |
| 47 | }; |
| 48 | |
| 49 | } //namespace intrusive { |
| 50 | } //namespace boost { |
| 51 | |
| 52 | #endif //BOOST_INTRUSIVE_DETAIL_VALUE_FUNCTORS_HPP |
| 53 | |