os/ossrv/ossrv_pub/boost_apis/boost/mpl/bind.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
#if !defined(BOOST_PP_IS_ITERATING)
sl@0
     3
sl@0
     4
///// header body
sl@0
     5
sl@0
     6
#ifndef BOOST_MPL_BIND_HPP_INCLUDED
sl@0
     7
#define BOOST_MPL_BIND_HPP_INCLUDED
sl@0
     8
sl@0
     9
// Copyright Peter Dimov 2001
sl@0
    10
// Copyright Aleksey Gurtovoy 2001-2004
sl@0
    11
//
sl@0
    12
// Distributed under the Boost Software License, Version 1.0. 
sl@0
    13
// (See accompanying file LICENSE_1_0.txt or copy at 
sl@0
    14
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
    15
//
sl@0
    16
// See http://www.boost.org/libs/mpl for documentation.
sl@0
    17
sl@0
    18
// $Source: /cvsroot/boost/boost/boost/mpl/bind.hpp,v $
sl@0
    19
// $Date: 2004/10/26 14:51:04 $
sl@0
    20
// $Revision: 1.13 $
sl@0
    21
sl@0
    22
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
sl@0
    23
#   include <boost/mpl/bind_fwd.hpp>
sl@0
    24
#   include <boost/mpl/placeholders.hpp>
sl@0
    25
#   include <boost/mpl/next.hpp>
sl@0
    26
#   include <boost/mpl/protect.hpp>
sl@0
    27
#   include <boost/mpl/apply_wrap.hpp>
sl@0
    28
#   include <boost/mpl/limits/arity.hpp>
sl@0
    29
#   include <boost/mpl/aux_/na.hpp>
sl@0
    30
#   include <boost/mpl/aux_/arity_spec.hpp>
sl@0
    31
#   include <boost/mpl/aux_/type_wrapper.hpp>
sl@0
    32
#   include <boost/mpl/aux_/yes_no.hpp>
sl@0
    33
#   if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
sl@0
    34
#       include <boost/type_traits/is_reference.hpp>
sl@0
    35
#   endif 
sl@0
    36
#endif
sl@0
    37
sl@0
    38
#include <boost/mpl/aux_/config/bind.hpp>
sl@0
    39
#include <boost/mpl/aux_/config/static_constant.hpp>
sl@0
    40
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
sl@0
    41
sl@0
    42
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
sl@0
    43
    && !defined(BOOST_MPL_PREPROCESSING_MODE)
sl@0
    44
sl@0
    45
#   if defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
sl@0
    46
#       define BOOST_MPL_PREPROCESSED_HEADER basic_bind.hpp
sl@0
    47
#   else
sl@0
    48
#       define BOOST_MPL_PREPROCESSED_HEADER bind.hpp
sl@0
    49
#   endif
sl@0
    50
#   include <boost/mpl/aux_/include_preprocessed.hpp>
sl@0
    51
sl@0
    52
#else
sl@0
    53
sl@0
    54
#   include <boost/mpl/aux_/preprocessor/params.hpp>
sl@0
    55
#   include <boost/mpl/aux_/preprocessor/default_params.hpp>
sl@0
    56
#   include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
sl@0
    57
#   include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
sl@0
    58
#   include <boost/mpl/aux_/preprocessor/ext_params.hpp>
sl@0
    59
#   include <boost/mpl/aux_/preprocessor/repeat.hpp>
sl@0
    60
#   include <boost/mpl/aux_/preprocessor/enum.hpp>
sl@0
    61
#   include <boost/mpl/aux_/preprocessor/add.hpp>
sl@0
    62
#   include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
sl@0
    63
#   include <boost/mpl/aux_/config/ctps.hpp>
sl@0
    64
#   include <boost/mpl/aux_/config/ttp.hpp>
sl@0
    65
#   include <boost/mpl/aux_/config/dtp.hpp>
sl@0
    66
#   include <boost/mpl/aux_/nttp_decl.hpp>
sl@0
    67
sl@0
    68
#   include <boost/preprocessor/iterate.hpp>
sl@0
    69
#   include <boost/preprocessor/comma_if.hpp>
sl@0
    70
#   include <boost/preprocessor/cat.hpp>
sl@0
    71
#   include <boost/preprocessor/inc.hpp>
sl@0
    72
sl@0
    73
namespace boost { namespace mpl {
sl@0
    74
sl@0
    75
// local macros, #undef-ined at the end of the header
sl@0
    76
#   define AUX778076_APPLY \
sl@0
    77
    BOOST_PP_CAT(apply_wrap,BOOST_MPL_LIMIT_METAFUNCTION_ARITY) \
sl@0
    78
    /**/
sl@0
    79
sl@0
    80
#   if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
sl@0
    81
#       define AUX778076_DMC_PARAM() , int dummy_
sl@0
    82
#   else
sl@0
    83
#       define AUX778076_DMC_PARAM()
sl@0
    84
#   endif
sl@0
    85
sl@0
    86
#   define AUX778076_BIND_PARAMS(param) \
sl@0
    87
    BOOST_MPL_PP_PARAMS( \
sl@0
    88
          BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
sl@0
    89
        , param \
sl@0
    90
        ) \
sl@0
    91
    /**/
sl@0
    92
sl@0
    93
#   define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
sl@0
    94
    BOOST_MPL_PP_DEFAULT_PARAMS( \
sl@0
    95
          BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
sl@0
    96
        , param \
sl@0
    97
        , value \
sl@0
    98
        ) \
sl@0
    99
    /**/
sl@0
   100
sl@0
   101
#   define AUX778076_BIND_N_PARAMS(n, param) \
sl@0
   102
    BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
sl@0
   103
    /**/
sl@0
   104
sl@0
   105
#   define AUX778076_BIND_N_SPEC_PARAMS(n, param, def) \
sl@0
   106
    BOOST_PP_COMMA_IF(n) \
sl@0
   107
    BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
sl@0
   108
    /**/
sl@0
   109
sl@0
   110
#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
sl@0
   111
#   define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
sl@0
   112
    AUX778076_BIND_DEFAULT_PARAMS(param, value) \
sl@0
   113
    /**/
sl@0
   114
#else
sl@0
   115
#   define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
sl@0
   116
    AUX778076_BIND_PARAMS(param) \
sl@0
   117
    /**/
sl@0
   118
#endif
sl@0
   119
sl@0
   120
namespace aux {
sl@0
   121
sl@0
   122
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
sl@0
   123
sl@0
   124
template<
sl@0
   125
      typename T, AUX778076_BIND_PARAMS(typename U)
sl@0
   126
    >
sl@0
   127
struct resolve_bind_arg
sl@0
   128
{
sl@0
   129
    typedef T type;
sl@0
   130
};
sl@0
   131
sl@0
   132
#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
sl@0
   133
sl@0
   134
template<
sl@0
   135
      typename T
sl@0
   136
    , typename Arg
sl@0
   137
    >
sl@0
   138
struct replace_unnamed_arg
sl@0
   139
{
sl@0
   140
    typedef Arg next;
sl@0
   141
    typedef T type;
sl@0
   142
};
sl@0
   143
sl@0
   144
template<
sl@0
   145
      typename Arg
sl@0
   146
    >
sl@0
   147
struct replace_unnamed_arg< arg<-1>,Arg >
sl@0
   148
{
sl@0
   149
    typedef typename Arg::next next;
sl@0
   150
    typedef Arg type;
sl@0
   151
};
sl@0
   152
sl@0
   153
#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
sl@0
   154
sl@0
   155
template<
sl@0
   156
      BOOST_MPL_AUX_NTTP_DECL(int, N), AUX778076_BIND_PARAMS(typename U)
sl@0
   157
    >
sl@0
   158
struct resolve_bind_arg< arg<N>,AUX778076_BIND_PARAMS(U) >
sl@0
   159
{
sl@0
   160
    typedef typename AUX778076_APPLY<mpl::arg<N>, AUX778076_BIND_PARAMS(U)>::type type;
sl@0
   161
};
sl@0
   162
sl@0
   163
#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
sl@0
   164
template<
sl@0
   165
      typename F, AUX778076_BIND_PARAMS(typename T), AUX778076_BIND_PARAMS(typename U)
sl@0
   166
    >
sl@0
   167
struct resolve_bind_arg< bind<F,AUX778076_BIND_PARAMS(T)>,AUX778076_BIND_PARAMS(U) >
sl@0
   168
{
sl@0
   169
    typedef bind<F,AUX778076_BIND_PARAMS(T)> f_;
sl@0
   170
    typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
sl@0
   171
};
sl@0
   172
#endif
sl@0
   173
sl@0
   174
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   175
sl@0
   176
// agurt, 15/jan/02: it's not a intended to be used as a function class, and 
sl@0
   177
// MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't
sl@0
   178
// work), so I went with the 'result_' here, and in all other similar cases
sl@0
   179
template< bool >
sl@0
   180
struct resolve_arg_impl
sl@0
   181
{
sl@0
   182
    template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
sl@0
   183
    {
sl@0
   184
        typedef T type;
sl@0
   185
    };
sl@0
   186
};
sl@0
   187
sl@0
   188
template<> 
sl@0
   189
struct resolve_arg_impl<true>
sl@0
   190
{
sl@0
   191
    template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
sl@0
   192
    {
sl@0
   193
        typedef typename AUX778076_APPLY<
sl@0
   194
              T
sl@0
   195
            , AUX778076_BIND_PARAMS(U)
sl@0
   196
            >::type type;
sl@0
   197
    };
sl@0
   198
};
sl@0
   199
sl@0
   200
// for 'resolve_bind_arg'
sl@0
   201
template< typename T > struct is_bind_template;
sl@0
   202
sl@0
   203
template< 
sl@0
   204
      typename T, AUX778076_BIND_PARAMS(typename U)
sl@0
   205
    >
sl@0
   206
struct resolve_bind_arg
sl@0
   207
    : resolve_arg_impl< is_bind_template<T>::value >
sl@0
   208
            ::template result_< T,AUX778076_BIND_PARAMS(U) >
sl@0
   209
{
sl@0
   210
};
sl@0
   211
sl@0
   212
#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
sl@0
   213
sl@0
   214
template< typename T > 
sl@0
   215
struct replace_unnamed_arg_impl
sl@0
   216
{
sl@0
   217
    template< typename Arg > struct result_
sl@0
   218
    {
sl@0
   219
        typedef Arg next;
sl@0
   220
        typedef T type;
sl@0
   221
    };
sl@0
   222
};
sl@0
   223
sl@0
   224
template<> 
sl@0
   225
struct replace_unnamed_arg_impl< arg<-1> >
sl@0
   226
{
sl@0
   227
    template< typename Arg > struct result_
sl@0
   228
    {
sl@0
   229
        typedef typename next<Arg>::type next;
sl@0
   230
        typedef Arg type;
sl@0
   231
    };
sl@0
   232
};
sl@0
   233
sl@0
   234
template< typename T, typename Arg > 
sl@0
   235
struct replace_unnamed_arg
sl@0
   236
    : replace_unnamed_arg_impl<T>::template result_<Arg>
sl@0
   237
{
sl@0
   238
};
sl@0
   239
sl@0
   240
#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
sl@0
   241
sl@0
   242
// agurt, 10/mar/02: the forward declaration has to appear before any of
sl@0
   243
// 'is_bind_helper' overloads, otherwise MSVC6.5 issues an ICE on it
sl@0
   244
template< BOOST_MPL_AUX_NTTP_DECL(int, arity_) > struct bind_chooser;
sl@0
   245
sl@0
   246
aux::no_tag is_bind_helper(...);
sl@0
   247
template< typename T > aux::no_tag is_bind_helper(protect<T>*);
sl@0
   248
sl@0
   249
// overload for "main" form
sl@0
   250
// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload 
sl@0
   251
// in case if we use 'aux::type_wrapper< bind<...> >' here, and all 
sl@0
   252
// 'bind' instantiations form a complete type anyway
sl@0
   253
#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
sl@0
   254
template<
sl@0
   255
      typename F, AUX778076_BIND_PARAMS(typename T)
sl@0
   256
    >
sl@0
   257
aux::yes_tag is_bind_helper(bind<F,AUX778076_BIND_PARAMS(T)>*);
sl@0
   258
#endif
sl@0
   259
sl@0
   260
template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
sl@0
   261
aux::yes_tag is_bind_helper(arg<N>*);
sl@0
   262
sl@0
   263
template< bool is_ref_ = true >
sl@0
   264
struct is_bind_template_impl
sl@0
   265
{
sl@0
   266
    template< typename T > struct result_
sl@0
   267
    {
sl@0
   268
        BOOST_STATIC_CONSTANT(bool, value = false);
sl@0
   269
    };
sl@0
   270
};
sl@0
   271
sl@0
   272
template<>
sl@0
   273
struct is_bind_template_impl<false>
sl@0
   274
{
sl@0
   275
    template< typename T > struct result_
sl@0
   276
    {
sl@0
   277
        BOOST_STATIC_CONSTANT(bool, value = 
sl@0
   278
              sizeof(aux::is_bind_helper(static_cast<T*>(0))) 
sl@0
   279
                == sizeof(aux::yes_tag)
sl@0
   280
            );
sl@0
   281
    };
sl@0
   282
};
sl@0
   283
sl@0
   284
template< typename T > struct is_bind_template
sl@0
   285
    : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
sl@0
   286
        ::template result_<T>
sl@0
   287
{
sl@0
   288
};
sl@0
   289
sl@0
   290
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   291
sl@0
   292
} // namespace aux
sl@0
   293
sl@0
   294
sl@0
   295
#define BOOST_PP_ITERATION_PARAMS_1 \
sl@0
   296
    (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind.hpp>))
sl@0
   297
#include BOOST_PP_ITERATE()
sl@0
   298
sl@0
   299
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
sl@0
   300
    && !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
sl@0
   301
/// if_/eval_if specializations
sl@0
   302
#   define AUX778076_SPEC_NAME if_
sl@0
   303
#   define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
sl@0
   304
#   include BOOST_PP_ITERATE()
sl@0
   305
sl@0
   306
#if !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
sl@0
   307
#   define AUX778076_SPEC_NAME eval_if
sl@0
   308
#   define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
sl@0
   309
#   include BOOST_PP_ITERATE()
sl@0
   310
#endif
sl@0
   311
#endif
sl@0
   312
sl@0
   313
// real C++ version is already taken care of
sl@0
   314
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
sl@0
   315
    && !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
sl@0
   316
sl@0
   317
namespace aux {
sl@0
   318
// apply_count_args
sl@0
   319
#define AUX778076_COUNT_ARGS_PREFIX bind
sl@0
   320
#define AUX778076_COUNT_ARGS_DEFAULT na
sl@0
   321
#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
sl@0
   322
#include <boost/mpl/aux_/count_args.hpp>
sl@0
   323
}
sl@0
   324
sl@0
   325
// bind
sl@0
   326
template<
sl@0
   327
      typename F, AUX778076_BIND_PARAMS(typename T) AUX778076_DMC_PARAM()
sl@0
   328
    >
sl@0
   329
struct bind
sl@0
   330
    : aux::bind_chooser<
sl@0
   331
          aux::bind_count_args<AUX778076_BIND_PARAMS(T)>::value
sl@0
   332
        >::template result_< F,AUX778076_BIND_PARAMS(T) >::type
sl@0
   333
{
sl@0
   334
};
sl@0
   335
sl@0
   336
BOOST_MPL_AUX_ARITY_SPEC(
sl@0
   337
      BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
sl@0
   338
    , bind
sl@0
   339
    )
sl@0
   340
sl@0
   341
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
sl@0
   342
      BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
sl@0
   343
    , bind
sl@0
   344
    )
sl@0
   345
sl@0
   346
sl@0
   347
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   348
sl@0
   349
#   undef AUX778076_BIND_NESTED_DEFAULT_PARAMS
sl@0
   350
#   undef AUX778076_BIND_N_SPEC_PARAMS
sl@0
   351
#   undef AUX778076_BIND_N_PARAMS
sl@0
   352
#   undef AUX778076_BIND_DEFAULT_PARAMS
sl@0
   353
#   undef AUX778076_BIND_PARAMS
sl@0
   354
#   undef AUX778076_DMC_PARAM
sl@0
   355
#   undef AUX778076_APPLY
sl@0
   356
sl@0
   357
}}
sl@0
   358
sl@0
   359
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
sl@0
   360
#endif // BOOST_MPL_BIND_HPP_INCLUDED
sl@0
   361
sl@0
   362
///// iteration, depth == 1
sl@0
   363
sl@0
   364
#elif BOOST_PP_ITERATION_DEPTH() == 1
sl@0
   365
sl@0
   366
#   define i_ BOOST_PP_FRAME_ITERATION(1)
sl@0
   367
sl@0
   368
#if defined(AUX778076_SPEC_NAME)
sl@0
   369
sl@0
   370
// lazy metafunction specialization
sl@0
   371
template< template< BOOST_MPL_PP_PARAMS(i_, typename T) > class F, typename Tag >
sl@0
   372
struct BOOST_PP_CAT(quote,i_);
sl@0
   373
sl@0
   374
template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME;
sl@0
   375
sl@0
   376
template<
sl@0
   377
      typename Tag AUX778076_BIND_N_PARAMS(i_, typename T)
sl@0
   378
    >
sl@0
   379
struct BOOST_PP_CAT(bind,i_)< 
sl@0
   380
      BOOST_PP_CAT(quote,i_)<AUX778076_SPEC_NAME,Tag>
sl@0
   381
    AUX778076_BIND_N_PARAMS(i_,T)
sl@0
   382
    >
sl@0
   383
{
sl@0
   384
    template<
sl@0
   385
          AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
sl@0
   386
        >
sl@0
   387
    struct apply
sl@0
   388
    {
sl@0
   389
     private:
sl@0
   390
        typedef mpl::arg<1> n1;
sl@0
   391
#       define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
sl@0
   392
#       include BOOST_PP_ITERATE()
sl@0
   393
sl@0
   394
        typedef typename AUX778076_SPEC_NAME<
sl@0
   395
              typename t1::type
sl@0
   396
            , BOOST_MPL_PP_EXT_PARAMS(2, BOOST_PP_INC(i_), t)
sl@0
   397
            >::type f_;
sl@0
   398
sl@0
   399
     public:
sl@0
   400
        typedef typename f_::type type;
sl@0
   401
    };
sl@0
   402
};
sl@0
   403
sl@0
   404
#undef AUX778076_SPEC_NAME
sl@0
   405
sl@0
   406
#else // AUX778076_SPEC_NAME
sl@0
   407
sl@0
   408
template<
sl@0
   409
      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
sl@0
   410
    >
sl@0
   411
struct BOOST_PP_CAT(bind,i_)
sl@0
   412
{
sl@0
   413
    template<
sl@0
   414
          AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
sl@0
   415
        >
sl@0
   416
    struct apply
sl@0
   417
    {
sl@0
   418
     private:
sl@0
   419
#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
sl@0
   420
sl@0
   421
        typedef aux::replace_unnamed_arg< F,mpl::arg<1> > r0;
sl@0
   422
        typedef typename r0::type a0;
sl@0
   423
        typedef typename r0::next n1;
sl@0
   424
        typedef typename aux::resolve_bind_arg<a0,AUX778076_BIND_PARAMS(U)>::type f_;
sl@0
   425
        ///
sl@0
   426
#   else
sl@0
   427
        typedef typename aux::resolve_bind_arg<F,AUX778076_BIND_PARAMS(U)>::type f_;
sl@0
   428
sl@0
   429
#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
sl@0
   430
sl@0
   431
#   if i_ > 0
sl@0
   432
#       define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
sl@0
   433
#       include BOOST_PP_ITERATE()
sl@0
   434
#   endif
sl@0
   435
sl@0
   436
     public:
sl@0
   437
sl@0
   438
#   define AUX778076_ARG(unused, i_, t) \
sl@0
   439
    BOOST_PP_COMMA_IF(i_) \
sl@0
   440
    typename BOOST_PP_CAT(t,BOOST_PP_INC(i_))::type \
sl@0
   441
/**/
sl@0
   442
sl@0
   443
        typedef typename BOOST_PP_CAT(apply_wrap,i_)<
sl@0
   444
              f_ 
sl@0
   445
            BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t)
sl@0
   446
            >::type type;
sl@0
   447
sl@0
   448
#   undef AUX778076_ARG
sl@0
   449
    };
sl@0
   450
};
sl@0
   451
sl@0
   452
namespace aux {
sl@0
   453
sl@0
   454
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
sl@0
   455
sl@0
   456
template<
sl@0
   457
      typename F AUX778076_BIND_N_PARAMS(i_, typename T), AUX778076_BIND_PARAMS(typename U)
sl@0
   458
    >
sl@0
   459
struct resolve_bind_arg<
sl@0
   460
      BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>,AUX778076_BIND_PARAMS(U)
sl@0
   461
    >
sl@0
   462
{
sl@0
   463
    typedef BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)> f_;
sl@0
   464
    typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
sl@0
   465
};
sl@0
   466
sl@0
   467
#else
sl@0
   468
sl@0
   469
template<
sl@0
   470
      typename F AUX778076_BIND_N_PARAMS(i_, typename T)
sl@0
   471
    >
sl@0
   472
aux::yes_tag
sl@0
   473
is_bind_helper(BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>*);
sl@0
   474
sl@0
   475
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   476
sl@0
   477
} // namespace aux
sl@0
   478
sl@0
   479
BOOST_MPL_AUX_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
sl@0
   480
BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
sl@0
   481
sl@0
   482
#   if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
sl@0
   483
#   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
sl@0
   484
    
sl@0
   485
#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
sl@0
   486
/// primary template (not a specialization!)
sl@0
   487
template<
sl@0
   488
      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
sl@0
   489
    >
sl@0
   490
struct bind
sl@0
   491
    : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
sl@0
   492
{
sl@0
   493
};
sl@0
   494
#else
sl@0
   495
template<
sl@0
   496
      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
sl@0
   497
    >
sl@0
   498
struct bind< F AUX778076_BIND_N_SPEC_PARAMS(i_, T, na) >
sl@0
   499
    : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
sl@0
   500
{
sl@0
   501
};
sl@0
   502
#endif
sl@0
   503
sl@0
   504
#   else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   505
sl@0
   506
namespace aux {
sl@0
   507
sl@0
   508
template<>
sl@0
   509
struct bind_chooser<i_>
sl@0
   510
{
sl@0
   511
    template<
sl@0
   512
          typename F, AUX778076_BIND_PARAMS(typename T)
sl@0
   513
        >
sl@0
   514
    struct result_
sl@0
   515
    {
sl@0
   516
        typedef BOOST_PP_CAT(bind,i_)< F AUX778076_BIND_N_PARAMS(i_,T) > type;
sl@0
   517
    };
sl@0
   518
};
sl@0
   519
sl@0
   520
} // namespace aux
sl@0
   521
sl@0
   522
#   endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
sl@0
   523
#   endif // BOOST_MPL_CFG_NO_BIND_TEMPLATE
sl@0
   524
sl@0
   525
#endif // AUX778076_SPEC_NAME
sl@0
   526
sl@0
   527
#   undef i_
sl@0
   528
sl@0
   529
///// iteration, depth == 2
sl@0
   530
sl@0
   531
#elif BOOST_PP_ITERATION_DEPTH() == 2
sl@0
   532
sl@0
   533
#   define j_ BOOST_PP_FRAME_ITERATION(2)
sl@0
   534
#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
sl@0
   535
sl@0
   536
        typedef aux::replace_unnamed_arg< BOOST_PP_CAT(T,j_),BOOST_PP_CAT(n,j_) > BOOST_PP_CAT(r,j_);
sl@0
   537
        typedef typename BOOST_PP_CAT(r,j_)::type BOOST_PP_CAT(a,j_);
sl@0
   538
        typedef typename BOOST_PP_CAT(r,j_)::next BOOST_PP_CAT(n,BOOST_PP_INC(j_));
sl@0
   539
        typedef aux::resolve_bind_arg<BOOST_PP_CAT(a,j_), AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
sl@0
   540
        ///
sl@0
   541
#   else
sl@0
   542
        typedef aux::resolve_bind_arg< BOOST_PP_CAT(T,j_),AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
sl@0
   543
sl@0
   544
#   endif
sl@0
   545
#   undef j_
sl@0
   546
sl@0
   547
#endif // BOOST_PP_IS_ITERATING