functional 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. #ifndef _STLP_FUNCTIONAL
  19. #ifndef _STLP_OUTERMOST_HEADER_ID
  20. # define _STLP_OUTERMOST_HEADER_ID 0x27
  21. # include <stl/_prolog.h>
  22. # define _STLP_FUNCTIONAL
  23. #endif
  24. #if (_STLP_OUTERMOST_HEADER_ID == 0x27)
  25. # ifndef _STLP_INTERNAL_FUNCTION_H
  26. # include <stl/_function.h>
  27. # endif
  28. #endif
  29. #if (_STLP_OUTERMOST_HEADER_ID != 0x27) || defined (_STLP_IMPORT_VENDOR_STD)
  30. # if defined (_STLP_HAS_INCLUDE_NEXT)
  31. # include_next <functional>
  32. # else
  33. # include _STLP_NATIVE_HEADER(functional)
  34. # endif
  35. #endif
  36. #if (_STLP_OUTERMOST_HEADER_ID == 0x27)
  37. # include <stl/_epilog.h>
  38. # undef _STLP_OUTERMOST_HEADER_ID
  39. #endif
  40. #if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
  41. #include <boost/ref.hpp>
  42. #include <boost/utility/result_of.hpp>
  43. #include <boost/bind/placeholders.hpp>
  44. #include <boost/mem_fn.hpp>
  45. #include <boost/bind.hpp>
  46. namespace boost {
  47. template<class T> class reference_wrapper;
  48. template<class T> reference_wrapper<T> const ref(T &);
  49. template<class T> inline reference_wrapper<T const> const cref(T const &);
  50. template<typename F> struct result_of;
  51. namespace _mfi {
  52. template<class R, class T> class dm;
  53. }
  54. template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f);
  55. } // namespace boost
  56. _STLP_BEGIN_NAMESPACE
  57. namespace tr1 {
  58. using ::boost::reference_wrapper;
  59. using ::boost::ref;
  60. using ::boost::cref;
  61. using ::boost::result_of;
  62. using ::boost::mem_fn;
  63. using ::boost::bind;
  64. namespace placeholders {
  65. using ::_1;
  66. using ::_2;
  67. using ::_3;
  68. using ::_4;
  69. using ::_5;
  70. using ::_6;
  71. using ::_7;
  72. using ::_8;
  73. using ::_9;
  74. } // placeholders
  75. } // namespace tr1
  76. _STLP_END_NAMESPACE
  77. #endif // !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT
  78. #endif /* _STLP_FUNCTIONAL */
  79. #if !defined(_STLP_FUNCTIONAL_FUN) && !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
  80. #ifndef BOOST_FUNCTION_NUM_ARGS // avoid recursive includes
  81. // #ifdef BOOST_FUNCTION_BASE_HEADER
  82. // #undef BOOST_FUNCTION_BASE_HEADER
  83. // #endif
  84. // #ifdef BOOST_FUNCTION_PROLOGUE_HPP
  85. // #undef BOOST_FUNCTION_PROLOGUE_HPP
  86. // #endif
  87. #define _STLP_FUNCTIONAL_FUN
  88. #ifndef BOOST_FUNCTION_BASE_HEADER // avoid recursive includes
  89. # include <boost/function.hpp>
  90. #else
  91. namespace boost {
  92. class bad_function_call;
  93. template<typename Signature, typename Allocator >
  94. class function;
  95. template<typename Signature, typename Allocator>
  96. void swap(function<Signature, Allocator>& f1, function<Signature, Allocator>& f2);
  97. }
  98. #endif
  99. _STLP_BEGIN_NAMESPACE
  100. namespace tr1 {
  101. using ::boost::bad_function_call;
  102. using ::boost::function;
  103. using ::boost::swap;
  104. } // namespace tr1
  105. _STLP_END_NAMESPACE
  106. #endif // !BOOST_FUNCTION_NUM_ARGS
  107. #endif // !_STLP_FUNCTIONAL_REF && !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT
  108. // Local Variables:
  109. // mode:C++
  110. // End: