2 * Copyright (c) 1996,1997
3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
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.
19 #ifndef _STLP_FUNCTIONAL
21 #ifndef _STLP_OUTERMOST_HEADER_ID
22 # define _STLP_OUTERMOST_HEADER_ID 0x27
23 # include <stl/_prolog.h>
24 # define _STLP_FUNCTIONAL
27 #if (_STLP_OUTERMOST_HEADER_ID == 0x27)
28 # ifndef _STLP_INTERNAL_FUNCTION_H
29 # include <stl/_function.h>
33 #if (_STLP_OUTERMOST_HEADER_ID != 0x27) || defined (_STLP_IMPORT_VENDOR_STD)
34 # if defined (_STLP_HAS_INCLUDE_NEXT)
35 # include_next <functional>
37 # include _STLP_NATIVE_HEADER(functional)
41 #if (_STLP_OUTERMOST_HEADER_ID == 0x27)
42 # include <stl/_epilog.h>
43 # undef _STLP_OUTERMOST_HEADER_ID
46 #if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
48 #include <boost/ref.hpp>
49 #include <boost/utility/result_of.hpp>
50 #include <boost/bind/placeholders.hpp>
51 #include <boost/mem_fn.hpp>
52 #include <boost/bind.hpp>
56 template<class T> class reference_wrapper;
57 template<class T> reference_wrapper<T> const ref(T &);
58 template<class T> inline reference_wrapper<T const> const cref(T const &);
60 template<typename F> struct result_of;
63 template<class R, class T> class dm;
66 template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f);
74 using ::boost::reference_wrapper;
78 using ::boost::result_of;
80 using ::boost::mem_fn;
84 namespace placeholders {
100 #endif // !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT
102 #endif /* _STLP_FUNCTIONAL */
104 #if !defined(_STLP_FUNCTIONAL_FUN) && !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
106 #ifndef BOOST_FUNCTION_NUM_ARGS // avoid recursive includes
108 // #ifdef BOOST_FUNCTION_BASE_HEADER
109 // #undef BOOST_FUNCTION_BASE_HEADER
112 // #ifdef BOOST_FUNCTION_PROLOGUE_HPP
113 // #undef BOOST_FUNCTION_PROLOGUE_HPP
116 #define _STLP_FUNCTIONAL_FUN
118 #ifndef BOOST_FUNCTION_BASE_HEADER // avoid recursive includes
119 # include <boost/function.hpp>
122 class bad_function_call;
123 template<typename Signature, typename Allocator >
125 template<typename Signature, typename Allocator>
126 void swap(function<Signature, Allocator>& f1, function<Signature, Allocator>& f2);
130 _STLP_BEGIN_NAMESPACE
134 using ::boost::bad_function_call;
135 using ::boost::function;
142 #endif // !BOOST_FUNCTION_NUM_ARGS
144 #endif // !_STLP_FUNCTIONAL_REF && !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT