Chris@16
|
1 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Ion Gaztanaga 2008
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 //
|
Chris@16
|
9 // See http://www.boost.org/libs/intrusive for documentation.
|
Chris@16
|
10 //
|
Chris@16
|
11 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
12
|
Chris@16
|
13 #ifndef BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
|
Chris@16
|
14 #define BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
|
Chris@16
|
15
|
Chris@16
|
16 #include <boost/intrusive/detail/config_begin.hpp>
|
Chris@16
|
17 #include <boost/intrusive/intrusive_fwd.hpp>
|
Chris@16
|
18
|
Chris@101
|
19 #include <boost/intrusive/detail/minimal_less_equal_header.hpp>
|
Chris@101
|
20
|
Chris@101
|
21 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
22 # pragma once
|
Chris@101
|
23 #endif
|
Chris@16
|
24
|
Chris@16
|
25 namespace boost {
|
Chris@16
|
26 namespace intrusive {
|
Chris@16
|
27
|
Chris@16
|
28 template <class T>
|
Chris@16
|
29 struct priority_compare
|
Chris@16
|
30 {
|
Chris@101
|
31 //Compatibility with std::binary_function
|
Chris@101
|
32 typedef T first_argument_type;
|
Chris@101
|
33 typedef T second_argument_type;
|
Chris@101
|
34 typedef bool result_type;
|
Chris@101
|
35
|
Chris@16
|
36 bool operator()(const T &val, const T &val2) const
|
Chris@16
|
37 {
|
Chris@16
|
38 return priority_order(val, val2);
|
Chris@16
|
39 }
|
Chris@16
|
40 };
|
Chris@16
|
41
|
Chris@16
|
42 /// @cond
|
Chris@16
|
43
|
Chris@16
|
44 template<class Less, class T>
|
Chris@16
|
45 struct get_prio
|
Chris@16
|
46 {
|
Chris@16
|
47 typedef Less type;
|
Chris@16
|
48 };
|
Chris@16
|
49
|
Chris@16
|
50
|
Chris@16
|
51 template<class T>
|
Chris@16
|
52 struct get_prio<void, T>
|
Chris@16
|
53 {
|
Chris@16
|
54 typedef ::boost::intrusive::priority_compare<T> type;
|
Chris@16
|
55 };
|
Chris@16
|
56
|
Chris@16
|
57 /// @endcond
|
Chris@16
|
58
|
Chris@101
|
59 } //namespace intrusive
|
Chris@101
|
60 } //namespace boost
|
Chris@16
|
61
|
Chris@16
|
62 #include <boost/intrusive/detail/config_end.hpp>
|
Chris@16
|
63
|
Chris@16
|
64 #endif //BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
|