Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:46

0001 // Copyright (C) 2012 Vicente J. Botet Escriba
0002 //
0003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 // 2013/04 Vicente J. Botet Escriba
0007 //    Provide implementation up to 9 parameters when BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined.
0008 //    Make use of Boost.Move
0009 //    Make use of Boost.Tuple (movable)
0010 // 2012/11 Vicente J. Botet Escriba
0011 //    Adapt to boost libc++ implementation
0012 
0013 //===----------------------------------------------------------------------===//
0014 //
0015 //                     The LLVM Compiler Infrastructure
0016 //
0017 // This file is dual licensed under the MIT and the University of Illinois Open
0018 // Source Licenses. See LICENSE.TXT for details.
0019 //
0020 // The invoker code is based on the one from libcxx.
0021 //===----------------------------------------------------------------------===//
0022 
0023 #ifndef BOOST_THREAD_DETAIL_INVOKER_HPP
0024 #define BOOST_THREAD_DETAIL_INVOKER_HPP
0025 
0026 #include <boost/config.hpp>
0027 
0028 #include <boost/utility/result_of.hpp>
0029 #include <boost/thread/detail/move.hpp>
0030 #include <boost/thread/detail/invoke.hpp>
0031 #include <boost/thread/detail/make_tuple_indices.hpp>
0032 #include <boost/thread/csbl/tuple.hpp>
0033 #include <boost/tuple/tuple.hpp>
0034 
0035 #include <boost/thread/detail/variadic_header.hpp>
0036 
0037 namespace boost
0038 {
0039   namespace detail
0040   {
0041 
0042 #if defined(BOOST_THREAD_PROVIDES_INVOKE) && ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && ! defined(BOOST_NO_CXX11_HDR_TUPLE)
0043 
0044     template <class Fp, class ... Args>
0045     class invoker
0046     {
0047       //typedef typename decay<Fp>::type Fpd;
0048       //typedef tuple<typename decay<Args>::type...> Argsd;
0049 
0050       //csbl::tuple<Fpd, Argsd...> f_;
0051       csbl::tuple<Fp, Args...> f_;
0052 
0053     public:
0054       BOOST_THREAD_COPYABLE_AND_MOVABLE( invoker)
0055       //typedef typename invoke_of<_Fp, _Args...>::type Rp;
0056       typedef typename result_of<Fp(Args...)>::type result_type;
0057 
0058       template <class F, class ... As>
0059       BOOST_SYMBOL_VISIBLE
0060       explicit invoker(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(As)... args)
0061       : f_(boost::forward<F>(f), boost::forward<As>(args)...)
0062       {}
0063 
0064       BOOST_SYMBOL_VISIBLE
0065       invoker(BOOST_THREAD_RV_REF(invoker) f) : f_(boost::move(BOOST_THREAD_RV(f).f_))
0066       {}
0067 
0068       BOOST_SYMBOL_VISIBLE
0069       invoker( const invoker& f) : f_(f.f_)
0070       {}
0071 
0072       BOOST_SYMBOL_VISIBLE
0073       invoker& operator=(BOOST_THREAD_RV_REF(invoker) f)
0074       {
0075         if (this != &f)
0076         {
0077           f_ = boost::move(BOOST_THREAD_RV(f).f_);
0078         }
0079         return *this;
0080       }
0081 
0082       BOOST_SYMBOL_VISIBLE
0083       invoker& operator=( BOOST_THREAD_COPY_ASSIGN_REF(invoker) f)
0084       {
0085         if (this != &f)
0086         {
0087           f_ = f.f_;
0088         }
0089         return *this;
0090       }
0091 
0092       result_type operator()()
0093       {
0094         typedef typename make_tuple_indices<1+sizeof...(Args), 1>::type Index;
0095         return execute(Index());
0096       }
0097     private:
0098       template <size_t ...Indices>
0099       result_type
0100       execute(tuple_indices<Indices...>)
0101       {
0102         return detail::invoke(boost::move(csbl::get<0>(f_)), boost::move(csbl::get<Indices>(f_))...);
0103       }
0104     };
0105 
0106     template <class R, class Fp, class ... Args>
0107     class invoker_ret
0108     {
0109       //typedef typename decay<Fp>::type Fpd;
0110       //typedef tuple<typename decay<Args>::type...> Argsd;
0111 
0112       //csbl::tuple<Fpd, Argsd...> f_;
0113       csbl::tuple<Fp, Args...> f_;
0114 
0115     public:
0116       BOOST_THREAD_COPYABLE_AND_MOVABLE( invoker_ret)
0117       typedef R result_type;
0118 
0119       template <class F, class ... As>
0120       BOOST_SYMBOL_VISIBLE
0121       explicit invoker_ret(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(As)... args)
0122       : f_(boost::forward<F>(f), boost::forward<As>(args)...)
0123       {}
0124 
0125       BOOST_SYMBOL_VISIBLE
0126       invoker_ret(BOOST_THREAD_RV_REF(invoker_ret) f) : f_(boost::move(BOOST_THREAD_RV(f).f_))
0127       {}
0128 
0129       result_type operator()()
0130       {
0131         typedef typename make_tuple_indices<1+sizeof...(Args), 1>::type Index;
0132         return execute(Index());
0133       }
0134     private:
0135       template <size_t ...Indices>
0136       result_type
0137       execute(tuple_indices<Indices...>)
0138       {
0139         return detail::invoke<R>(boost::move(csbl::get<0>(f_)), boost::move(csbl::get<Indices>(f_))...);
0140       }
0141     };
0142   //BOOST_THREAD_DCL_MOVABLE_BEG(X) invoker<Fp> BOOST_THREAD_DCL_MOVABLE_END
0143 #else
0144 
0145 #if ! defined BOOST_MSVC && defined(BOOST_THREAD_PROVIDES_INVOKE)
0146 
0147 #define BOOST_THREAD_RV_REF_ARG_T(z, n, unused) BOOST_PP_COMMA_IF(n) BOOST_THREAD_RV_REF(Arg##n)
0148 #define BOOST_THREAD_RV_REF_A_T(z, n, unused) BOOST_PP_COMMA_IF(n) BOOST_THREAD_RV_REF(A##n)
0149 #define BOOST_THREAD_RV_REF_ARG(z, n, unused) , BOOST_THREAD_RV_REF(Arg##n) arg##n
0150 #define BOOST_THREAD_FWD_REF_A(z, n, unused)   , BOOST_THREAD_FWD_REF(A##n) arg##n
0151 #define BOOST_THREAD_FWD_REF_ARG(z, n, unused) , BOOST_THREAD_FWD_REF(Arg##n) arg##n
0152 #define BOOST_THREAD_FWD_PARAM(z, n, unused) , boost::forward<Arg##n>(arg##n)
0153 #define BOOST_THREAD_FWD_PARAM_A(z, n, unused) , boost::forward<A##n>(arg##n)
0154 #define BOOST_THREAD_DCL(z, n, unused) Arg##n v##n;
0155 #define BOOST_THREAD_MOVE_PARAM(z, n, unused) , v##n(boost::move(arg##n))
0156 #define BOOST_THREAD_FORWARD_PARAM_A(z, n, unused) , v##n(boost::forward<A##n>(arg##n))
0157 #define BOOST_THREAD_MOVE_RHS_PARAM(z, n, unused) , v##n(boost::move(x.v##n))
0158 #define BOOST_THREAD_MOVE_DCL(z, n, unused) , boost::move(v##n)
0159 #define BOOST_THREAD_MOVE_DCL_T(z, n, unused) BOOST_PP_COMMA_IF(n) boost::move(v##n)
0160 #define BOOST_THREAD_ARG_DEF(z, n, unused) , class Arg##n = tuples::null_type
0161 
0162   template  <class Fp, class Arg = tuples::null_type
0163     BOOST_PP_REPEAT(BOOST_THREAD_MAX_ARGS, BOOST_THREAD_ARG_DEF, ~)
0164     >
0165     class invoker;
0166 
0167 #define BOOST_THREAD_ASYNC_FUNCT(z, n, unused) \
0168     template <class Fp BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class Arg) > \
0169     class invoker<Fp BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, Arg)> \
0170     { \
0171       Fp fp_; \
0172       BOOST_PP_REPEAT(n, BOOST_THREAD_DCL, ~) \
0173     public: \
0174       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker) \
0175       typedef typename result_of<Fp(BOOST_PP_ENUM_PARAMS(n, Arg))>::type result_type; \
0176       \
0177       template <class F BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class A) > \
0178       BOOST_SYMBOL_VISIBLE \
0179       explicit invoker(BOOST_THREAD_FWD_REF(F) f \
0180           BOOST_PP_REPEAT(n, BOOST_THREAD_FWD_REF_A, ~) \
0181       ) \
0182       : fp_(boost::forward<F>(f)) \
0183       BOOST_PP_REPEAT(n, BOOST_THREAD_FORWARD_PARAM_A, ~) \
0184       {} \
0185       \
0186       BOOST_SYMBOL_VISIBLE \
0187       invoker(BOOST_THREAD_RV_REF(invoker) x) \
0188       : fp_(boost::move(x.fp_)) \
0189       BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_RHS_PARAM, ~) \
0190       {} \
0191       \
0192       result_type operator()() { \
0193         return detail::invoke(boost::move(fp_) \
0194             BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_DCL, ~) \
0195         ); \
0196       } \
0197     }; \
0198     \
0199     template <class R BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class Arg) > \
0200     class invoker<R(*)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_ARG_T, ~)) BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, Arg)> \
0201     { \
0202       typedef R(*Fp)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_ARG_T, ~)); \
0203       Fp fp_; \
0204       BOOST_PP_REPEAT(n, BOOST_THREAD_DCL, ~) \
0205     public: \
0206       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker) \
0207       typedef typename result_of<Fp(BOOST_PP_ENUM_PARAMS(n, Arg))>::type result_type; \
0208       \
0209       template <class R2 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class A) > \
0210       BOOST_SYMBOL_VISIBLE \
0211       explicit invoker(R2(*f)(BOOST_PP_REPEAT(n, BOOST_THREAD_RV_REF_A_T, ~))  \
0212           BOOST_PP_REPEAT(n, BOOST_THREAD_FWD_REF_A, ~) \
0213       ) \
0214       : fp_(f) \
0215       BOOST_PP_REPEAT(n, BOOST_THREAD_FORWARD_PARAM_A, ~) \
0216       {} \
0217       \
0218       BOOST_SYMBOL_VISIBLE \
0219       invoker(BOOST_THREAD_RV_REF(invoker) x) \
0220       : fp_(x.fp_) \
0221       BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_RHS_PARAM, ~) \
0222       {} \
0223       \
0224       result_type operator()() { \
0225         return fp_( \
0226             BOOST_PP_REPEAT(n, BOOST_THREAD_MOVE_DCL_T, ~) \
0227         ); \
0228       } \
0229     };
0230 
0231     BOOST_PP_REPEAT(BOOST_THREAD_MAX_ARGS, BOOST_THREAD_ASYNC_FUNCT, ~)
0232 
0233     #undef BOOST_THREAD_RV_REF_ARG_T
0234     #undef BOOST_THREAD_RV_REF_ARG
0235     #undef BOOST_THREAD_FWD_REF_ARG
0236     #undef BOOST_THREAD_FWD_REF_A
0237     #undef BOOST_THREAD_FWD_PARAM
0238     #undef BOOST_THREAD_FWD_PARAM_A
0239     #undef BOOST_THREAD_DCL
0240     #undef BOOST_THREAD_MOVE_PARAM
0241     #undef BOOST_THREAD_MOVE_RHS_PARAM
0242     #undef BOOST_THREAD_MOVE_DCL
0243     #undef BOOST_THREAD_ARG_DEF
0244     #undef BOOST_THREAD_ASYNC_FUNCT
0245 
0246 #else
0247 
0248     template <class Fp,
0249     class T0 = tuples::null_type, class T1 = tuples::null_type, class T2 = tuples::null_type,
0250     class T3 = tuples::null_type, class T4 = tuples::null_type, class T5 = tuples::null_type,
0251     class T6 = tuples::null_type, class T7 = tuples::null_type, class T8 = tuples::null_type
0252     , class T9 = tuples::null_type
0253     >
0254     class invoker;
0255 
0256     template <class Fp,
0257     class T0 , class T1 , class T2 ,
0258     class T3 , class T4 , class T5 ,
0259     class T6 , class T7 , class T8 >
0260     class invoker<Fp, T0, T1, T2, T3, T4, T5, T6, T7, T8>
0261     {
0262       Fp fp_;
0263       T0 v0_;
0264       T1 v1_;
0265       T2 v2_;
0266       T3 v3_;
0267       T4 v4_;
0268       T5 v5_;
0269       T6 v6_;
0270       T7 v7_;
0271       T8 v8_;
0272       //::boost::tuple<Fp, T0, T1, T2, T3, T4, T5, T6, T7, T8> f_;
0273 
0274     public:
0275       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0276       typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6, T7, T8)>::type result_type;
0277 
0278       BOOST_SYMBOL_VISIBLE
0279       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0280           , BOOST_THREAD_RV_REF(T0) a0
0281           , BOOST_THREAD_RV_REF(T1) a1
0282           , BOOST_THREAD_RV_REF(T2) a2
0283           , BOOST_THREAD_RV_REF(T3) a3
0284           , BOOST_THREAD_RV_REF(T4) a4
0285           , BOOST_THREAD_RV_REF(T5) a5
0286           , BOOST_THREAD_RV_REF(T6) a6
0287           , BOOST_THREAD_RV_REF(T7) a7
0288           , BOOST_THREAD_RV_REF(T8) a8
0289       )
0290       : fp_(boost::move(f))
0291       , v0_(boost::move(a0))
0292       , v1_(boost::move(a1))
0293       , v2_(boost::move(a2))
0294       , v3_(boost::move(a3))
0295       , v4_(boost::move(a4))
0296       , v5_(boost::move(a5))
0297       , v6_(boost::move(a6))
0298       , v7_(boost::move(a7))
0299       , v8_(boost::move(a8))
0300       {}
0301 
0302       BOOST_SYMBOL_VISIBLE
0303       invoker(BOOST_THREAD_RV_REF(invoker) f)
0304       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0305       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0306       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0307       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0308       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0309       , v4_(boost::move(BOOST_THREAD_RV(f).v4_))
0310       , v5_(boost::move(BOOST_THREAD_RV(f).v5_))
0311       , v6_(boost::move(BOOST_THREAD_RV(f).v6_))
0312       , v7_(boost::move(BOOST_THREAD_RV(f).v7_))
0313       , v8_(boost::move(BOOST_THREAD_RV(f).v8_))
0314       {}
0315 
0316       result_type operator()()
0317       {
0318         return detail::invoke(boost::move(fp_)
0319             , boost::move(v0_)
0320             , boost::move(v1_)
0321             , boost::move(v2_)
0322             , boost::move(v3_)
0323             , boost::move(v4_)
0324             , boost::move(v5_)
0325             , boost::move(v6_)
0326             , boost::move(v7_)
0327             , boost::move(v8_)
0328         );
0329       }
0330     };
0331     template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7 >
0332     class invoker<Fp, T0, T1, T2, T3, T4, T5, T6, T7>
0333     {
0334       Fp fp_;
0335       T0 v0_;
0336       T1 v1_;
0337       T2 v2_;
0338       T3 v3_;
0339       T4 v4_;
0340       T5 v5_;
0341       T6 v6_;
0342       T7 v7_;
0343     public:
0344       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0345       typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6, T7)>::type result_type;
0346 
0347       BOOST_SYMBOL_VISIBLE
0348       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0349           , BOOST_THREAD_RV_REF(T0) a0
0350           , BOOST_THREAD_RV_REF(T1) a1
0351           , BOOST_THREAD_RV_REF(T2) a2
0352           , BOOST_THREAD_RV_REF(T3) a3
0353           , BOOST_THREAD_RV_REF(T4) a4
0354           , BOOST_THREAD_RV_REF(T5) a5
0355           , BOOST_THREAD_RV_REF(T6) a6
0356           , BOOST_THREAD_RV_REF(T7) a7
0357       )
0358       : fp_(boost::move(f))
0359       , v0_(boost::move(a0))
0360       , v1_(boost::move(a1))
0361       , v2_(boost::move(a2))
0362       , v3_(boost::move(a3))
0363       , v4_(boost::move(a4))
0364       , v5_(boost::move(a5))
0365       , v6_(boost::move(a6))
0366       , v7_(boost::move(a7))
0367       {}
0368 
0369       BOOST_SYMBOL_VISIBLE
0370       invoker(BOOST_THREAD_RV_REF(invoker) f)
0371       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0372       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0373       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0374       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0375       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0376       , v4_(boost::move(BOOST_THREAD_RV(f).v4_))
0377       , v5_(boost::move(BOOST_THREAD_RV(f).v5_))
0378       , v6_(boost::move(BOOST_THREAD_RV(f).v6_))
0379       , v7_(boost::move(BOOST_THREAD_RV(f).v7_))
0380       {}
0381 
0382       result_type operator()()
0383       {
0384         return detail::invoke(boost::move(fp_)
0385             , boost::move(v0_)
0386             , boost::move(v1_)
0387             , boost::move(v2_)
0388             , boost::move(v3_)
0389             , boost::move(v4_)
0390             , boost::move(v5_)
0391             , boost::move(v6_)
0392             , boost::move(v7_)
0393         );
0394       }
0395     };
0396     template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5, class T6>
0397     class invoker<Fp, T0, T1, T2, T3, T4, T5, T6>
0398     {
0399       Fp fp_;
0400       T0 v0_;
0401       T1 v1_;
0402       T2 v2_;
0403       T3 v3_;
0404       T4 v4_;
0405       T5 v5_;
0406       T6 v6_;
0407     public:
0408       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0409       typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5, T6)>::type result_type;
0410 
0411       BOOST_SYMBOL_VISIBLE
0412       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0413           , BOOST_THREAD_RV_REF(T0) a0
0414           , BOOST_THREAD_RV_REF(T1) a1
0415           , BOOST_THREAD_RV_REF(T2) a2
0416           , BOOST_THREAD_RV_REF(T3) a3
0417           , BOOST_THREAD_RV_REF(T4) a4
0418           , BOOST_THREAD_RV_REF(T5) a5
0419           , BOOST_THREAD_RV_REF(T6) a6
0420       )
0421       : fp_(boost::move(f))
0422       , v0_(boost::move(a0))
0423       , v1_(boost::move(a1))
0424       , v2_(boost::move(a2))
0425       , v3_(boost::move(a3))
0426       , v4_(boost::move(a4))
0427       , v5_(boost::move(a5))
0428       , v6_(boost::move(a6))
0429       {}
0430 
0431       BOOST_SYMBOL_VISIBLE
0432       invoker(BOOST_THREAD_RV_REF(invoker) f)
0433       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0434       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0435       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0436       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0437       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0438       , v4_(boost::move(BOOST_THREAD_RV(f).v4_))
0439       , v5_(boost::move(BOOST_THREAD_RV(f).v5_))
0440       , v6_(boost::move(BOOST_THREAD_RV(f).v6_))
0441       {}
0442 
0443       result_type operator()()
0444       {
0445         return detail::invoke(boost::move(fp_)
0446             , boost::move(v0_)
0447             , boost::move(v1_)
0448             , boost::move(v2_)
0449             , boost::move(v3_)
0450             , boost::move(v4_)
0451             , boost::move(v5_)
0452             , boost::move(v6_)
0453         );
0454       }
0455     };
0456     template <class Fp, class T0, class T1, class T2, class T3, class T4, class T5>
0457     class invoker<Fp, T0, T1, T2, T3, T4, T5>
0458     {
0459       Fp fp_;
0460       T0 v0_;
0461       T1 v1_;
0462       T2 v2_;
0463       T3 v3_;
0464       T4 v4_;
0465       T5 v5_;
0466     public:
0467       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0468       typedef typename result_of<Fp(T0, T1, T2, T3, T4, T5)>::type result_type;
0469 
0470       BOOST_SYMBOL_VISIBLE
0471       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0472           , BOOST_THREAD_RV_REF(T0) a0
0473           , BOOST_THREAD_RV_REF(T1) a1
0474           , BOOST_THREAD_RV_REF(T2) a2
0475           , BOOST_THREAD_RV_REF(T3) a3
0476           , BOOST_THREAD_RV_REF(T4) a4
0477           , BOOST_THREAD_RV_REF(T5) a5
0478       )
0479       : fp_(boost::move(f))
0480       , v0_(boost::move(a0))
0481       , v1_(boost::move(a1))
0482       , v2_(boost::move(a2))
0483       , v3_(boost::move(a3))
0484       , v4_(boost::move(a4))
0485       , v5_(boost::move(a5))
0486       {}
0487 
0488       BOOST_SYMBOL_VISIBLE
0489       invoker(BOOST_THREAD_RV_REF(invoker) f)
0490       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0491       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0492       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0493       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0494       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0495       , v4_(boost::move(BOOST_THREAD_RV(f).v4_))
0496       , v5_(boost::move(BOOST_THREAD_RV(f).v5_))
0497       {}
0498 
0499       result_type operator()()
0500       {
0501         return detail::invoke(boost::move(fp_)
0502             , boost::move(v0_)
0503             , boost::move(v1_)
0504             , boost::move(v2_)
0505             , boost::move(v3_)
0506             , boost::move(v4_)
0507             , boost::move(v5_)
0508         );
0509       }
0510     };
0511     template <class Fp, class T0, class T1, class T2, class T3, class T4>
0512     class invoker<Fp, T0, T1, T2, T3, T4>
0513     {
0514       Fp fp_;
0515       T0 v0_;
0516       T1 v1_;
0517       T2 v2_;
0518       T3 v3_;
0519       T4 v4_;
0520     public:
0521       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0522       typedef typename result_of<Fp(T0, T1, T2, T3, T4)>::type result_type;
0523 
0524       BOOST_SYMBOL_VISIBLE
0525       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0526           , BOOST_THREAD_RV_REF(T0) a0
0527           , BOOST_THREAD_RV_REF(T1) a1
0528           , BOOST_THREAD_RV_REF(T2) a2
0529           , BOOST_THREAD_RV_REF(T3) a3
0530           , BOOST_THREAD_RV_REF(T4) a4
0531       )
0532       : fp_(boost::move(f))
0533       , v0_(boost::move(a0))
0534       , v1_(boost::move(a1))
0535       , v2_(boost::move(a2))
0536       , v3_(boost::move(a3))
0537       , v4_(boost::move(a4))
0538       {}
0539 
0540       BOOST_SYMBOL_VISIBLE
0541       invoker(BOOST_THREAD_RV_REF(invoker) f)
0542       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0543       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0544       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0545       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0546       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0547       , v4_(boost::move(BOOST_THREAD_RV(f).v4_))
0548       {}
0549 
0550       result_type operator()()
0551       {
0552         return detail::invoke(boost::move(fp_)
0553             , boost::move(v0_)
0554             , boost::move(v1_)
0555             , boost::move(v2_)
0556             , boost::move(v3_)
0557             , boost::move(v4_)
0558         );
0559       }
0560     };
0561     template <class Fp, class T0, class T1, class T2, class T3>
0562     class invoker<Fp, T0, T1, T2, T3>
0563     {
0564       Fp fp_;
0565       T0 v0_;
0566       T1 v1_;
0567       T2 v2_;
0568       T3 v3_;
0569     public:
0570       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0571       typedef typename result_of<Fp(T0, T1, T2, T3)>::type result_type;
0572 
0573       BOOST_SYMBOL_VISIBLE
0574       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0575           , BOOST_THREAD_RV_REF(T0) a0
0576           , BOOST_THREAD_RV_REF(T1) a1
0577           , BOOST_THREAD_RV_REF(T2) a2
0578           , BOOST_THREAD_RV_REF(T3) a3
0579       )
0580       : fp_(boost::move(f))
0581       , v0_(boost::move(a0))
0582       , v1_(boost::move(a1))
0583       , v2_(boost::move(a2))
0584       , v3_(boost::move(a3))
0585       {}
0586 
0587       BOOST_SYMBOL_VISIBLE
0588       invoker(BOOST_THREAD_RV_REF(invoker) f)
0589       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0590       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0591       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0592       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0593       , v3_(boost::move(BOOST_THREAD_RV(f).v3_))
0594       {}
0595 
0596       result_type operator()()
0597       {
0598         return detail::invoke(boost::move(fp_)
0599             , boost::move(v0_)
0600             , boost::move(v1_)
0601             , boost::move(v2_)
0602             , boost::move(v3_)
0603         );
0604       }
0605     };
0606     template <class Fp, class T0, class T1, class T2>
0607     class invoker<Fp, T0, T1, T2>
0608     {
0609       Fp fp_;
0610       T0 v0_;
0611       T1 v1_;
0612       T2 v2_;
0613     public:
0614       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0615       typedef typename result_of<Fp(T0, T1, T2)>::type result_type;
0616 
0617       BOOST_SYMBOL_VISIBLE
0618       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0619           , BOOST_THREAD_RV_REF(T0) a0
0620           , BOOST_THREAD_RV_REF(T1) a1
0621           , BOOST_THREAD_RV_REF(T2) a2
0622       )
0623       : fp_(boost::move(f))
0624       , v0_(boost::move(a0))
0625       , v1_(boost::move(a1))
0626       , v2_(boost::move(a2))
0627       {}
0628 
0629       BOOST_SYMBOL_VISIBLE
0630       invoker(BOOST_THREAD_RV_REF(invoker) f)
0631       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0632       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0633       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0634       , v2_(boost::move(BOOST_THREAD_RV(f).v2_))
0635       {}
0636 
0637       result_type operator()()
0638       {
0639         return detail::invoke(boost::move(fp_)
0640             , boost::move(v0_)
0641             , boost::move(v1_)
0642             , boost::move(v2_)
0643         );
0644       }
0645     };
0646     template <class Fp, class T0, class T1>
0647     class invoker<Fp, T0, T1>
0648     {
0649       Fp fp_;
0650       T0 v0_;
0651       T1 v1_;
0652     public:
0653       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0654       typedef typename result_of<Fp(T0, T1)>::type result_type;
0655 
0656       BOOST_SYMBOL_VISIBLE
0657       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0658           , BOOST_THREAD_RV_REF(T0) a0
0659           , BOOST_THREAD_RV_REF(T1) a1
0660       )
0661       : fp_(boost::move(f))
0662       , v0_(boost::move(a0))
0663       , v1_(boost::move(a1))
0664       {}
0665 
0666       BOOST_SYMBOL_VISIBLE
0667       invoker(BOOST_THREAD_RV_REF(invoker) f)
0668       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0669       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0670       , v1_(boost::move(BOOST_THREAD_RV(f).v1_))
0671       {}
0672 
0673       result_type operator()()
0674       {
0675         return detail::invoke(boost::move(fp_)
0676             , boost::move(v0_)
0677             , boost::move(v1_)
0678         );
0679       }
0680     };
0681     template <class Fp, class T0>
0682     class invoker<Fp, T0>
0683     {
0684       Fp fp_;
0685       T0 v0_;
0686     public:
0687       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0688       typedef typename result_of<Fp(T0)>::type result_type;
0689 
0690       BOOST_SYMBOL_VISIBLE
0691       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f
0692           , BOOST_THREAD_RV_REF(T0) a0
0693       )
0694       : fp_(boost::move(f))
0695       , v0_(boost::move(a0))
0696       {}
0697 
0698       BOOST_SYMBOL_VISIBLE
0699       invoker(BOOST_THREAD_RV_REF(invoker) f)
0700       : fp_(boost::move(BOOST_THREAD_RV(f).fp))
0701       , v0_(boost::move(BOOST_THREAD_RV(f).v0_))
0702       {}
0703 
0704       result_type operator()()
0705       {
0706         return detail::invoke(boost::move(fp_)
0707             , boost::move(v0_)
0708         );
0709       }
0710     };
0711     template <class Fp>
0712     class invoker<Fp>
0713     {
0714       Fp fp_;
0715     public:
0716       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0717       typedef typename result_of<Fp()>::type result_type;
0718       BOOST_SYMBOL_VISIBLE
0719       explicit invoker(BOOST_THREAD_FWD_REF(Fp) f)
0720       : fp_(boost::move(f))
0721       {}
0722 
0723       BOOST_SYMBOL_VISIBLE
0724       invoker(BOOST_THREAD_RV_REF(invoker) f)
0725       : fp_(boost::move(f.fp_))
0726       {}
0727       result_type operator()()
0728       {
0729         return fp_();
0730       }
0731     };
0732     template <class R>
0733     class invoker<R(*)()>
0734     {
0735       typedef R(*Fp)();
0736       Fp fp_;
0737     public:
0738       BOOST_THREAD_COPYABLE_AND_MOVABLE(invoker)
0739       typedef typename result_of<Fp()>::type result_type;
0740       BOOST_SYMBOL_VISIBLE
0741       explicit invoker(Fp f)
0742       : fp_(f)
0743       {}
0744 
0745       BOOST_SYMBOL_VISIBLE
0746       invoker(BOOST_THREAD_RV_REF(invoker) f)
0747       : fp_(f.fp_)
0748       {}
0749       result_type operator()()
0750       {
0751         return fp_();
0752       }
0753     };
0754 #endif
0755 #endif
0756 
0757   }
0758 }
0759 
0760 #include <boost/thread/detail/variadic_footer.hpp>
0761 
0762 #endif // header