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)
6 #ifndef BOOST_TR1_FUNCTIONAL_HPP_INCLUDED
7 # define BOOST_TR1_FUNCTIONAL_HPP_INCLUDED
8 # include <boost/tr1/detail/config.hpp>
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 # if defined(BOOST_HAS_INCLUDE_NEXT) && !defined(BOOST_TR1_DISABLE_INCLUDE_NEXT)
18 # include_next BOOST_TR1_HEADER(functional)
20 # include <boost/tr1/detail/config_all.hpp>
21 # include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))
25 #ifndef BOOST_HAS_TR1_REFERENCE_WRAPPER
27 #include <boost/ref.hpp>
29 namespace std{ namespace tr1{
31 using ::boost::reference_wrapper;
37 #endif // BOOST_HAS_TR1_REFERENCE_WRAPPER
39 #if !defined(BOOST_HAS_TR1_RESULT_OF)\
40 && !defined(BOOST_NO_SFINAE)
43 // we can only actually include result_of.hpp if the compiler
44 // really does support it, otherwise we just get endless errors...
46 #include <boost/utility/result_of.hpp>
48 namespace std{ namespace tr1{
52 : ::boost::tr1_result_of<F>
57 #endif // BOOST_HAS_TR1_RESULT_OF
59 #ifndef BOOST_HAS_TR1_MEM_FN
61 #include <boost/mem_fn.hpp>
63 namespace std{ namespace tr1{
69 #endif // BOOST_HAS_TR1_MEM_FN
72 #ifndef BOOST_HAS_TR1_BIND
74 #include <boost/bind.hpp>
76 namespace std{ namespace tr1{
78 using ::boost::is_bind_expression;
79 using ::boost::is_placeholder;
81 namespace placeholders {
82 #ifndef BOOST_BIND_NO_PLACEHOLDERS
99 #ifndef BOOST_HAS_TR1_FUNCTION
100 // polymorphic function object wrappers:
101 #include <boost/function.hpp>
102 #include <boost/detail/workaround.hpp>
104 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x582) \
105 && !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
106 namespace std{ namespace tr1{
108 using ::boost::bad_function_call;
109 using ::boost::function;
115 #endif // BOOST_HAS_TR1_FUNCTION
117 #ifndef BOOST_HAS_TR1_HASH
119 // This header can get included by boost/hash.hpp
120 // leading to cyclic dependencies. As a workaround
121 // we forward declare boost::hash and include
122 // the actual header later.
125 template <class T> struct hash;
128 namespace std{ namespace tr1{
129 //using ::boost::hash;
132 struct hash : public boost::hash<T>
138 #include <boost/functional/hash.hpp>