functional 3.6 KB

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