| 1 |
/* |
| 2 |
* Copyright (c) 1996,1997 |
| 3 |
* Silicon Graphics Computer Systems, Inc. |
| 4 |
* |
| 5 |
* Copyright (c) 1999 |
| 6 |
* Boris Fomitchev |
| 7 |
* |
| 8 |
* This material is provided "as is", with absolutely no warranty expressed |
| 9 |
* or implied. Any use is at your own risk. |
| 10 |
* |
| 11 |
* Permission to use or copy this software for any purpose is hereby granted |
| 12 |
* without fee, provided the above notices are retained on all copies. |
| 13 |
* Permission to modify the code and to distribute modified code is granted, |
| 14 |
* provided the above notices are retained, and a notice that the code was |
| 15 |
* modified is included with the above copyright notice. |
| 16 |
* |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef _STLP_FUNCTIONAL |
| 20 |
#define _STLP_FUNCTIONAL |
| 21 |
|
| 22 |
#ifndef _STLP_OUTERMOST_HEADER_ID |
| 23 |
# define _STLP_OUTERMOST_HEADER_ID 0x27 |
| 24 |
# include <stl/_prolog.h> |
| 25 |
#endif |
| 26 |
|
| 27 |
#if (_STLP_OUTERMOST_HEADER_ID == 0x27) |
| 28 |
# ifndef _STLP_INTERNAL_FUNCTION_H |
| 29 |
# include <stl/_function.h> |
| 30 |
# endif |
| 31 |
#endif |
| 32 |
|
| 33 |
#if (_STLP_OUTERMOST_HEADER_ID == 0x27) |
| 34 |
# include <stl/_epilog.h> |
| 35 |
# undef _STLP_OUTERMOST_HEADER_ID |
| 36 |
#endif |
| 37 |
|
| 38 |
#if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT) |
| 39 |
|
| 40 |
#include <boost/ref.hpp> |
| 41 |
#include <boost/utility/result_of.hpp> |
| 42 |
#include <boost/bind/placeholders.hpp> |
| 43 |
#include <boost/mem_fn.hpp> |
| 44 |
#include <boost/bind.hpp> |
| 45 |
|
| 46 |
namespace boost { |
| 47 |
|
| 48 |
template<class T> class reference_wrapper; |
| 49 |
template<class T> reference_wrapper<T> const ref(T &); |
| 50 |
template<class T> inline reference_wrapper<T const> const cref(T const &); |
| 51 |
|
| 52 |
template<typename F> struct result_of; |
| 53 |
|
| 54 |
namespace _mfi { |
| 55 |
template<class R, class T> class dm; |
| 56 |
} |
| 57 |
|
| 58 |
template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f); |
| 59 |
|
| 60 |
} // namespace boost |
| 61 |
|
| 62 |
_STLP_BEGIN_NAMESPACE |
| 63 |
|
| 64 |
namespace tr1 { |
| 65 |
|
| 66 |
using ::boost::reference_wrapper; |
| 67 |
using ::boost::ref; |
| 68 |
using ::boost::cref; |
| 69 |
|
| 70 |
using ::boost::result_of; |
| 71 |
|
| 72 |
using ::boost::mem_fn; |
| 73 |
|
| 74 |
using ::boost::bind; |
| 75 |
|
| 76 |
namespace placeholders { |
| 77 |
using ::_1; |
| 78 |
using ::_2; |
| 79 |
using ::_3; |
| 80 |
using ::_4; |
| 81 |
using ::_5; |
| 82 |
using ::_6; |
| 83 |
using ::_7; |
| 84 |
using ::_8; |
| 85 |
using ::_9; |
| 86 |
} // placeholders |
| 87 |
|
| 88 |
} // namespace tr1 |
| 89 |
|
| 90 |
_STLP_END_NAMESPACE |
| 91 |
|
| 92 |
#endif // !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT |
| 93 |
|
| 94 |
#endif /* _STLP_FUNCTIONAL */ |
| 95 |
|
| 96 |
#if !defined(_STLP_FUNCTIONAL_FUN) && !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT) |
| 97 |
|
| 98 |
#ifndef BOOST_FUNCTION_NUM_ARGS // avoid recursive includes |
| 99 |
|
| 100 |
// #ifdef BOOST_FUNCTION_BASE_HEADER |
| 101 |
// #undef BOOST_FUNCTION_BASE_HEADER |
| 102 |
// #endif |
| 103 |
|
| 104 |
// #ifdef BOOST_FUNCTION_PROLOGUE_HPP |
| 105 |
// #undef BOOST_FUNCTION_PROLOGUE_HPP |
| 106 |
// #endif |
| 107 |
|
| 108 |
#define _STLP_FUNCTIONAL_FUN |
| 109 |
|
| 110 |
#ifndef BOOST_FUNCTION_BASE_HEADER // avoid recursive includes |
| 111 |
# include <boost/function.hpp> |
| 112 |
#else |
| 113 |
namespace boost { |
| 114 |
class bad_function_call; |
| 115 |
template<typename Signature, typename Allocator > |
| 116 |
class function; |
| 117 |
template<typename Signature, typename Allocator> |
| 118 |
void swap(function<Signature, Allocator>& f1, function<Signature, Allocator>& f2); |
| 119 |
} |
| 120 |
#endif |
| 121 |
|
| 122 |
_STLP_BEGIN_NAMESPACE |
| 123 |
|
| 124 |
namespace tr1 { |
| 125 |
|
| 126 |
using ::boost::bad_function_call; |
| 127 |
using ::boost::function; |
| 128 |
using ::boost::swap; |
| 129 |
|
| 130 |
} // namespace tr1 |
| 131 |
|
| 132 |
_STLP_END_NAMESPACE |
| 133 |
|
| 134 |
#endif // !BOOST_FUNCTION_NUM_ARGS |
| 135 |
|
| 136 |
#endif // !_STLP_FUNCTIONAL_REF && !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT |
| 137 |
|
| 138 |
// Local Variables: |
| 139 |
// mode:C++ |
| 140 |
// End: |