First public contribution.
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 # ifdef BOOST_HAS_INCLUDE_NEXT
18 # include_next BOOST_TR1_HEADER(functional)
20 # include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))
24 #ifndef BOOST_HAS_TR1_REFERENCE_WRAPPER
26 #include <boost/ref.hpp>
28 namespace std{ namespace tr1{
30 using ::boost::reference_wrapper;
36 #endif // BOOST_HAS_TR1_REFERENCE_WRAPPER
38 #if !defined(BOOST_HAS_TR1_RESULT_OF)\
39 && !defined(BOOST_NO_SFINAE) && \
40 !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
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{
50 using ::boost::result_of;
54 #endif // BOOST_HAS_TR1_RESULT_OF
56 #ifndef BOOST_HAS_TR1_MEM_FN
58 #include <boost/mem_fn.hpp>
60 namespace std{ namespace tr1{
66 #endif // BOOST_HAS_TR1_MEM_FN
69 #ifndef BOOST_HAS_TR1_BIND
71 #include <boost/bind.hpp>
73 namespace std{ namespace tr1{
75 // These aren't supported in this release but are in mainline cvs:
76 // using ::boost::is_bind_expression;
77 // using ::boost::is_placeholder;
79 namespace placeholders {
80 #ifndef BOOST_BIND_NO_PLACEHOLDERS
97 #ifndef BOOST_HAS_TR1_FUNCTION
98 // polymorphic function object wrappers:
99 #include <boost/function.hpp>
100 #include <boost/detail/workaround.hpp>
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{
107 using ::boost::bad_function_call;
108 using ::boost::function;
114 #endif // BOOST_HAS_TR1_FUNCTION
116 #ifndef BOOST_HAS_TR1_HASH
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.
124 template <class T> struct hash;
127 namespace std{ namespace tr1{
132 #include <boost/functional/hash.hpp>