|
1 // (C) Copyright John Maddock 2005. |
|
2 // Use, modification and distribution are subject to the |
|
3 // Boost Software License, Version 1.0. (See accompanying file |
|
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
|
5 |
|
6 #ifndef BOOST_TR1_FUNCTIONAL_HPP_INCLUDED |
|
7 # define BOOST_TR1_FUNCTIONAL_HPP_INCLUDED |
|
8 # include <boost/tr1/detail/config.hpp> |
|
9 # include <functional> |
|
10 |
|
11 #if defined(BOOST_HAS_TR1_REFERENCE_WRAPPER) \ |
|
12 || defined(BOOST_HAS_TR1_RESULT_OF)\ |
|
13 || defined(BOOST_HAS_TR1_MEM_FN)\ |
|
14 || defined(BOOST_HAS_TR1_BIND)\ |
|
15 || defined(BOOST_HAS_TR1_FUNCTION)\ |
|
16 || defined(BOOST_HAS_TR1_HASH) |
|
17 # ifdef BOOST_HAS_INCLUDE_NEXT |
|
18 # include_next BOOST_TR1_HEADER(functional) |
|
19 # else |
|
20 # include <boost/tr1/detail/config_all.hpp> |
|
21 # include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional)) |
|
22 # endif |
|
23 #endif |
|
24 |
|
25 #ifndef BOOST_HAS_TR1_REFERENCE_WRAPPER |
|
26 |
|
27 #include <boost/ref.hpp> |
|
28 |
|
29 namespace std{ namespace tr1{ |
|
30 |
|
31 using ::boost::reference_wrapper; |
|
32 using ::boost::ref; |
|
33 using ::boost::cref; |
|
34 |
|
35 } } |
|
36 |
|
37 #endif // BOOST_HAS_TR1_REFERENCE_WRAPPER |
|
38 |
|
39 #if !defined(BOOST_HAS_TR1_RESULT_OF)\ |
|
40 && !defined(BOOST_NO_SFINAE) && \ |
|
41 !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) |
|
42 |
|
43 // |
|
44 // we can only actually include result_of.hpp if the compiler |
|
45 // really does support it, otherwise we just get endless errors... |
|
46 // |
|
47 #include <boost/utility/result_of.hpp> |
|
48 |
|
49 namespace std{ namespace tr1{ |
|
50 |
|
51 using ::boost::result_of; |
|
52 |
|
53 } } |
|
54 |
|
55 #endif // BOOST_HAS_TR1_RESULT_OF |
|
56 |
|
57 #ifndef BOOST_HAS_TR1_MEM_FN |
|
58 // mem_fn: |
|
59 #include <boost/mem_fn.hpp> |
|
60 |
|
61 namespace std{ namespace tr1{ |
|
62 |
|
63 using boost::mem_fn; |
|
64 |
|
65 } } |
|
66 |
|
67 #endif // BOOST_HAS_TR1_MEM_FN |
|
68 |
|
69 |
|
70 #ifndef BOOST_HAS_TR1_BIND |
|
71 // Bind: |
|
72 #include <boost/bind.hpp> |
|
73 |
|
74 namespace std{ namespace tr1{ |
|
75 |
|
76 using ::boost::is_bind_expression; |
|
77 using ::boost::is_placeholder; |
|
78 using ::boost::bind; |
|
79 namespace placeholders { |
|
80 #ifndef BOOST_BIND_NO_PLACEHOLDERS |
|
81 using ::_1; |
|
82 using ::_2; |
|
83 using ::_3; |
|
84 using ::_4; |
|
85 using ::_5; |
|
86 using ::_6; |
|
87 using ::_7; |
|
88 using ::_8; |
|
89 using ::_9; |
|
90 #endif |
|
91 } // placeholders |
|
92 |
|
93 } } |
|
94 |
|
95 #endif |
|
96 |
|
97 #ifndef BOOST_HAS_TR1_FUNCTION |
|
98 // polymorphic function object wrappers: |
|
99 #include <boost/function.hpp> |
|
100 #include <boost/detail/workaround.hpp> |
|
101 |
|
102 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x582) \ |
|
103 && !BOOST_WORKAROUND(BOOST_MSVC, < 1310) \ |
|
104 && !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) |
|
105 namespace std{ namespace tr1{ |
|
106 |
|
107 using ::boost::bad_function_call; |
|
108 using ::boost::function; |
|
109 using ::boost::swap; |
|
110 |
|
111 }} |
|
112 #endif |
|
113 |
|
114 #endif // BOOST_HAS_TR1_FUNCTION |
|
115 |
|
116 #ifndef BOOST_HAS_TR1_HASH |
|
117 // |
|
118 // This header can get included by boost/hash.hpp |
|
119 // leading to cyclic dependencies. As a workaround |
|
120 // we forward declare boost::hash and include |
|
121 // the actual header later. |
|
122 // |
|
123 namespace boost{ |
|
124 template <class T> struct hash; |
|
125 } |
|
126 |
|
127 namespace std{ namespace tr1{ |
|
128 using ::boost::hash; |
|
129 |
|
130 }} |
|
131 |
|
132 #include <boost/functional/hash.hpp> |
|
133 |
|
134 #endif |
|
135 |
|
136 #endif |
|
137 |