1 /////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2008
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/libs/intrusive for documentation.
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
14 #define BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
16 #include <boost/intrusive/detail/config_begin.hpp>
17 #include <boost/intrusive/detail/workaround.hpp>
18 #include <boost/intrusive/intrusive_fwd.hpp>
20 #include <boost/intrusive/detail/minimal_less_equal_header.hpp>
22 #if defined(BOOST_HAS_PRAGMA_ONCE)
32 void priority_order();
36 template <class T = void>
37 struct priority_compare
39 //Compatibility with std::binary_function
40 typedef T first_argument_type;
41 typedef T second_argument_type;
42 typedef bool result_type;
44 BOOST_INTRUSIVE_FORCEINLINE bool operator()(const T &val, const T &val2) const
46 return priority_order(val, val2);
51 struct priority_compare<void>
53 template<class T, class U>
54 BOOST_INTRUSIVE_FORCEINLINE bool operator()(const T &t, const U &u) const
56 return priority_order(t, u);
62 template<class PrioComp, class T>
65 typedef PrioComp type;
70 struct get_prio<void, T>
72 typedef ::boost::intrusive::priority_compare<T> type;
77 } //namespace intrusive
80 #include <boost/intrusive/detail/config_end.hpp>
82 #endif //BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP