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 21#ifndef _STLP_OUTERMOST_HEADER_ID 22# define _STLP_OUTERMOST_HEADER_ID 0x27 23# include <stl/_prolog.h> 24# define _STLP_FUNCTIONAL 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) || defined (_STLP_IMPORT_VENDOR_STD) 34# if defined (_STLP_HAS_INCLUDE_NEXT) 35# include_next <functional> 36# else 37# include _STLP_NATIVE_HEADER(functional) 38# endif 39#endif 40 41#if (_STLP_OUTERMOST_HEADER_ID == 0x27) 42# include <stl/_epilog.h> 43# undef _STLP_OUTERMOST_HEADER_ID 44#endif 45 46#if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT) 47 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> 53 54namespace boost { 55 56template<class T> class reference_wrapper; 57template<class T> reference_wrapper<T> const ref(T &); 58template<class T> inline reference_wrapper<T const> const cref(T const &); 59 60template<typename F> struct result_of; 61 62namespace _mfi { 63template<class R, class T> class dm; 64} 65 66template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f); 67 68} // namespace boost 69 70_STLP_BEGIN_NAMESPACE 71 72namespace tr1 { 73 74using ::boost::reference_wrapper; 75using ::boost::ref; 76using ::boost::cref; 77 78using ::boost::result_of; 79 80using ::boost::mem_fn; 81 82using ::boost::bind; 83 84namespace placeholders { 85 using ::_1; 86 using ::_2; 87 using ::_3; 88 using ::_4; 89 using ::_5; 90 using ::_6; 91 using ::_7; 92 using ::_8; 93 using ::_9; 94} // placeholders 95 96} // namespace tr1 97 98_STLP_END_NAMESPACE 99 100#endif // !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT 101 102#endif /* _STLP_FUNCTIONAL */ 103 104#if !defined(_STLP_FUNCTIONAL_FUN) && !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT) 105 106#ifndef BOOST_FUNCTION_NUM_ARGS // avoid recursive includes 107 108// #ifdef BOOST_FUNCTION_BASE_HEADER 109// #undef BOOST_FUNCTION_BASE_HEADER 110// #endif 111 112// #ifdef BOOST_FUNCTION_PROLOGUE_HPP 113// #undef BOOST_FUNCTION_PROLOGUE_HPP 114// #endif 115 116#define _STLP_FUNCTIONAL_FUN 117 118#ifndef BOOST_FUNCTION_BASE_HEADER // avoid recursive includes 119# include <boost/function.hpp> 120#else 121namespace boost { 122class bad_function_call; 123template<typename Signature, typename Allocator > 124class function; 125template<typename Signature, typename Allocator> 126void swap(function<Signature, Allocator>& f1, function<Signature, Allocator>& f2); 127} 128#endif 129 130_STLP_BEGIN_NAMESPACE 131 132namespace tr1 { 133 134using ::boost::bad_function_call; 135using ::boost::function; 136using ::boost::swap; 137 138} // namespace tr1 139 140_STLP_END_NAMESPACE 141 142#endif // !BOOST_FUNCTION_NUM_ARGS 143 144#endif // !_STLP_FUNCTIONAL_REF && !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT 145 146// Local Variables: 147// mode:C++ 148// End: 149