Home | History | Annotate | Download | only in stlport
      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 
     54 namespace boost {
     55 
     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 &);
     59 
     60 template<typename F> struct result_of;
     61 
     62 namespace _mfi {
     63 template<class R, class T> class dm;
     64 }
     65 
     66 template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f);
     67 
     68 } // namespace boost
     69 
     70 _STLP_BEGIN_NAMESPACE
     71 
     72 namespace tr1 {
     73 
     74 using ::boost::reference_wrapper;
     75 using ::boost::ref;
     76 using ::boost::cref;
     77 
     78 using ::boost::result_of;
     79 
     80 using ::boost::mem_fn;
     81 
     82 using ::boost::bind;
     83 
     84 namespace 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
    121 namespace boost {
    122 class bad_function_call;
    123 template<typename Signature, typename Allocator >
    124 class function;
    125 template<typename Signature, typename Allocator>
    126 void swap(function<Signature, Allocator>& f1, function<Signature, Allocator>& f2);
    127 }
    128 #endif
    129 
    130 _STLP_BEGIN_NAMESPACE
    131 
    132 namespace tr1 {
    133 
    134 using ::boost::bad_function_call;
    135 using ::boost::function;
    136 using ::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