Esempio n. 1
0
  {};
#else

#if !defined(BOOST_DISPATCH_DONT_USE_PREPROCESSED_FILES)
#include <boost/dispatch/functor/meta/preprocessed/call.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_DISPATCH_CREATE_PREPROCESSED_FILES) && __INCLUDE_LEVEL__ == 0
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/call.hpp")
#endif

#define M0(z,n,t) \
template<class Tag, BOOST_PP_ENUM_PARAMS(n,class A), class Site> \
struct call<Tag(BOOST_PP_ENUM_PARAMS(n,A)),Site> \
: meta::result_of<functor<Tag, typename mpl::eval_if< is_same<Site, void>, default_site<Tag>, mpl::identity<Site> >::type>(BOOST_PP_ENUM_PARAMS(n,A))> \
{}; \
/**/

  BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_INC(BOOST_DISPATCH_MAX_ARITY),M0,~)
#undef M0

#if defined(__WAVE__) && defined(BOOST_DISPATCH_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif

#endif
} } }

#endif

Esempio n. 2
0
File: call.hpp Progetto: KWMalik/nt2
{
  BOOST_PP_REPEAT_FROM_TO ( 1
                          , BOOST_PP_INC(BOOST_PP_MIN ( BOOST_DISPATCH_MAX_ARITY
                                                      , BOOST_PROTO_MAX_ARITY
                                                      )
                                        )
                          ,M5,~
                          )

  template<class Func,class Dummy>
  struct implement<Func(tag::ast_),tag::formal_,Dummy>
  {
    template<class Sig> struct result;
    BOOST_PP_REPEAT_FROM_TO ( 1
                            , BOOST_PP_INC(BOOST_PP_MIN ( BOOST_DISPATCH_MAX_ARITY
                                                        , BOOST_PROTO_MAX_ARITY
                                                        )
                                          )
                            ,M0,~
                            )
  };
} } }

#undef M0
#undef M1
#undef M2
#undef M3
#undef M4
#undef M5

#if defined(__WAVE__) && defined(BOOST_DISPATCH_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
Esempio n. 3
0
File: sign.hpp Progetto: go4and/lib
        typedef typename boost::function_traits<S>::result_type type;
    };

    typedef void * arg1_type;
    typedef typename boost::function_traits<S>::arg1_type real_context;

    sign_t(const F & f) 
        : f_(f) {}

    typename boost::function_traits<S>::result_type operator()(void * context) const
    {
        return f_(downcast<real_context>(context));
    }

    BOOST_PP_REPEAT_FROM_TO(
        1, BOOST_PP_INC(CALC_SIGN_MAX_ARITY),
        CALC_SIGN_PRIVATE_REDIRECT, _ )
private:
    template<class T>
    static typename boost::enable_if<boost::is_same<T, void*>, T&>::type
    downcast(void *& context)
    {
        return context;
    }
    
    template<class T>
    static typename boost::enable_if<boost::mpl::and_<boost::is_pointer<T>, boost::mpl::not_<boost::is_same<T, void*> > >, T>::type
    downcast(void * context)
    {
        return static_cast<T>(context);
    }
  {
    tie(this);
  }

#if defined(GENERATING_DOCUMENTATION)
  /// Establish a connection to an endpoint corresponding to a resolver query.
  /**
   * This constructor automatically establishes a connection based on the
   * supplied resolver query parameters. The arguments are used to construct
   * a resolver query object.
   */
  template <typename T1, ..., typename TN>
  explicit basic_socket_iostream(T1 t1, ..., TN tn);
#else
  BOOST_PP_REPEAT_FROM_TO(
      1, BOOST_PP_INC(BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY),
      BOOST_ASIO_PRIVATE_CTR_DEF, _ )
#endif

#if defined(GENERATING_DOCUMENTATION)
  /// Establish a connection to an endpoint corresponding to a resolver query.
  /**
   * This function automatically establishes a connection based on the supplied
   * resolver query parameters. The arguments are used to construct a resolver
   * query object.
   */
  template <typename T1, ..., typename TN>
  void connect(T1 t1, ..., TN tn);
#else
  BOOST_PP_REPEAT_FROM_TO(
      1, BOOST_PP_INC(BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY),
// Copyright (C) 2004 Arkadiy Vertleyb
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <boost/typeof/encode_decode_params.hpp>

#define n BOOST_PP_ITERATION()

// function pointers

template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
{
    typedef R BOOST_PP_CAT(P, n);
    typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
};

template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
{
    typedef Iter iter0;
    BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
    typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p));
    typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};

#ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES

    // function references

    template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
Esempio n. 6
0
                        return                                                  \
                            function_equal_()(                                  \
                                proto::child_c<0>(e1)                           \
                              , proto::child_c<0>(e2)                           \
                            )                                                   \
                            BOOST_PP_REPEAT_FROM_TO(                            \
                                1                                               \
                              , N                                               \
                              , BOOST_PHOENIX_FUNCTION_EQUAL_R                  \
                              , _                                               \
                            );                                                  \
                    }                                                           \
                /**/

                BOOST_PP_REPEAT_FROM_TO(
                    1
                  , BOOST_PP_INC(BOOST_PROTO_MAX_ARITY)
                  , BOOST_PHOENIX_FUNCTION_EQUAL
                  , _
                )
                #undef BOOST_PHOENIX_FUNCTION_EQUAL_R
                #undef BOOST_PHOENIX_FUNCTION_EQUAL

#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif

#endif

Esempio n. 7
0
	}
	//
	// boost::tuple
	//
	template<typename Archive>
	void serialize(
		Archive& ar,
		boost::tuple<>&,
		unsigned int const
		)
	{}
	template<typename Archive, typename T1>
	void serialize(
		Archive& ar,
		boost::tuple<T1>& t,
		unsigned int const
		)
	{
		ar
			& boost::serialization::make_nvp("head", t.head);
	}
	BOOST_PP_REPEAT_FROM_TO(
		2,
		BOOST_PP_INC(SPRIG_SERIALIZATION_BOOST_TUPLE_ARGS_MAX),
		SPRIG_SERIALIZATION_BOOST_TUPLE_SERIALIZE_GEN,
		BOOST_PP_EMPTY()
		);
SPRIG_SERIALIZATION_NAMESPACE_END

#endif	// #ifndef SPRIG_SERIALIZATION_BOOST_DETAIL_TUPLE_HEAD_TAIL_HPP
Esempio n. 8
0
       and end recursive call of EachFunctor */                                \
    typedef typename boost::mpl::if_< isEnd,                                   \
                                      EmptyFunctor,                            \
                                      TmpNextCall>::type NextCall;             \
                                                                               \
    PMACC_NO_NVCC_HDWARNING                                                    \
    HDINLINE void operator()() const                                           \
    {                                                                          \
        FunctorType()();                                                       \
        NextCall()();                                                          \
    }                                                                          \
    /* N=PMACC_MAX_FUNCTOR_OPERATOR_PARAMS                                     \
     * template<typename T0, ... , typename TN>                                \
     * create operator()(const T0 t0,...,const TN tN)                          \
     */                                                                        \
    BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(PMACC_MAX_FUNCTOR_OPERATOR_PARAMS), \
                            PMACC_FOREACH_OPERATOR_CONST, _)                   \
}; /*end of struct ForEach*/

//########################### end preprocessor definitions #####################

/* N = PMACC_MAX_FUNCTOR_TEMPLATES
 * create: 
 * struct definitions ForEach<Accessor,itBegin,itEnd,T0,...,TN>{}
 *  \see PMACC_FOREACH_STRUCT
 */
BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(PMACC_MAX_FUNCTOR_TEMPLATES), PMACC_FOREACH_STRUCT, _)


/* delete all preprocessor defines to avoid conflicts in other files */
#undef PMACC_FOREACH_STRUCT
Esempio n. 9
0
BOOST_PP_REPEAT(N_ARG, T_KEY, nil)

#define T_VAL(z, n, text) struct val##n { \
void test() { printf("val %d\n", n); }    \
};

BOOST_PP_REPEAT(N_ARG, T_VAL, nil)

#define T_MAP_PAIR(z, n, text) x11::pair<key##n, val##n>

#define T_MAP(z, n, text) typedef x11::map< \
BOOST_PP_ENUM_ ## z(n, T_MAP_PAIR, nil)     \
> map##n##_t;

BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(N_ARG), T_MAP, nil)

template <typename T, typename Enable = void>
struct x_pack;

#define T_HAS_KEY(z, n, text) x11::has_key<T, key##n>

#define T_X_TYPE(z, n, text) typename x11::at<T, key##n>::type a##n;

#define T_X_TEST(z, n, text) a##n.test();

#define T_PACK(z, n, text) template <typename T>              \
struct x_pack<T, typename std::enable_if<                     \
	x11::and_<                                            \
		x11::equal_to<x11::size<T>, x11::long_<n>>,   \
		BOOST_PP_ENUM_ ## z(n, T_HAS_KEY, nil)        \
Esempio n. 10
0
#else // BOOST_PP_IS_ITERATING
#if BOOST_PP_ITERATION_DEPTH() == 1

#   define i_ BOOST_PP_FRAME_ITERATION(1)

template<
      typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
    >
struct BOOST_PP_CAT(apply,i_)
    : BOOST_PP_CAT(apply_wrap,i_)< 
          typename lambda<F>::type
        AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
        >
{
    BOOST_MPL_AUX_LAMBDA_SUPPORT(
          BOOST_PP_INC(i_)
        , BOOST_PP_CAT(apply,i_)
        , (F AUX778076_APPLY_N_COMMA_PARAMS(i_,T))
        )
};




#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
/// primary template (not a specialization!)
template<
      typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
    >
struct apply
    : BOOST_PP_CAT(apply,i_)< F AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >
Esempio n. 11
0
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>

namespace nt2 { namespace container { namespace ext
{
  template<class T>
  struct of_size_reduce;

  #define M0(z, n, t)                                                                              \
  template<BOOST_PP_ENUM_PARAMS(n, std::ptrdiff_t D)>                                              \
  struct of_size_reduce< of_size_< BOOST_PP_ENUM_PARAMS(n, D) > >                                  \
  {                                                                                                \
    typedef of_size_<1 BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) BOOST_PP_ENUM_SHIFTED_PARAMS(n, D)> type; \
  };                                                                                               \
  /**/
  BOOST_PP_REPEAT(BOOST_PP_INC(NT2_MAX_DIMENSIONS), M0, ~)
  #undef M0

  //============================================================================
  // This is the factorized size_of for all reduction function.
  // For any given reduction function tag RED, the registration of their
  // size_of is simply :
  //
  // namespace nt2 { namespace container { namespace ext
  // {
  //  template<class Domain, class Expr, int N>
  //  struct size_of<RED,Domain,N,Expr> : reduction_size_of<Expr, N>
  //  {};
  // } } }
  //
  //============================================================================
Esempio n. 12
0
// Helper to initialize a base object so a derived class can use this
// object in the initialization of another base class.  Used by
// Dietmar Kuehl from ideas by Ron Klatcho to solve the problem of a
// base class needing to be initialized by a member.

// Contributed by Daryle Walker

template < typename MemberType, int UniqueID = 0 >
class base_from_member
{
protected:
    MemberType  member;

    base_from_member()
        : member()
        {}

    BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
     BOOST_PRIVATE_CTR_DEF, _ )

};  // boost::base_from_member

}  // namespace boost


// Undo any private macros
#undef BOOST_PRIVATE_CTR_DEF


#endif  // BOOST_UTILITY_BASE_FROM_MEMBER_HPP
Esempio n. 13
0
    typedef of_size_<BOOST_PP_ENUM(n, M1, n)> result_type;                                         \
                                                                                                   \
    template<int N, class Dummy = void>                                                            \
    struct impl {};                                                                                \
                                                                                                   \
    BOOST_PP_REPEAT(BOOST_PP_INC(n), M3, n)                                                        \
                                                                                                   \
    BOOST_FORCEINLINE result_type                                                                  \
    operator()(Shape const&, Sizes const& s, Bases const& b, Children const& children) const       \
    {                                                                                              \
      return impl<result_type::static_size>::call(s, b, children);                                 \
    }                                                                                              \
  };                                                                                               \
  /**/

  BOOST_PP_REPEAT_FROM_TO(2, BOOST_PP_INC(NT2_MAX_DIMENSIONS), M0, ~)
  #undef M0
  #undef M1
  #undef M2
  #undef M3
  #undef M4
  #undef M5

  template< class Domain
          , class Shape, class Sizes, class Bases
          , class Children
          >
  struct make_size<1, Domain, Shape, Sizes, Bases, Children>
  {
    typedef typename boost::proto::result_of::child_c<Children&, 0>::value_type::extent_type idx0_sz;
    static const std::size_t shape_min = Shape::static_size > 2u ? 2u : Shape::static_size;
Esempio n. 14
0
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#endif

namespace nt2 { namespace meta
{
  template<class Tag> struct validate
  {
    template<class Sig> struct result;
    #if defined(BOOST_HAS_VARIADIC_TMPL)
    template<class This, class... Args>
    struct  result<This(Args...)>
					: std::tr1::result_of<typename functors::functor<Tag>::validate(Args...)>
    {};
    #else
    #define M0(z,n,t)                                                     \
    template<class This, BOOST_PP_ENUM_PARAMS(n,class A)>                 \
    struct  result<This(BOOST_PP_ENUM_PARAMS(n,A))>                       \
					: std::tr1::result_of<typename functors::functor<Tag>						\
                                    ::validate(BOOST_PP_ENUM_PARAMS(n,A)) \
                            >                                             \
    {};                                                                   \
    /**/

    BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_INC(NT2_MAX_ARITY),M0,~)
    #undef M0
    #endif
  };
} }

#endif
Esempio n. 15
0
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>

#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()

#ifndef BOOST_TYPEOF_LIMIT_FUNCTION_ARITY
#define BOOST_TYPEOF_LIMIT_FUNCTION_ARITY 10
#endif

enum 
{
    FUN_ID                          = BOOST_TYPEOF_UNIQUE_ID(),
    FUN_PTR_ID                      = FUN_ID +  1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    FUN_REF_ID                      = FUN_ID +  2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    MEM_FUN_ID                      = FUN_ID +  3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    CONST_MEM_FUN_ID                = FUN_ID +  4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    VOLATILE_MEM_FUN_ID             = FUN_ID +  5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    VOLATILE_CONST_MEM_FUN_ID       = FUN_ID +  6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    FUN_VAR_ID                      = FUN_ID +  7 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    FUN_VAR_PTR_ID                  = FUN_ID +  8 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    FUN_VAR_REF_ID                  = FUN_ID +  9 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    MEM_FUN_VAR_ID                  = FUN_ID + 10 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    CONST_MEM_FUN_VAR_ID            = FUN_ID + 11 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    VOLATILE_MEM_FUN_VAR_ID         = FUN_ID + 12 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
    VOLATILE_CONST_MEM_FUN_VAR_ID   = FUN_ID + 13 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
};

BOOST_TYPEOF_BEGIN_ENCODE_NS
Esempio n. 16
0
#elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
  template <typename... T>
  basic_socket_streambuf<Protocol, StreamSocketService,
    Time, TimeTraits, TimerService>* connect(T... x)
  {
    init_buffers();
    this->basic_socket<Protocol, StreamSocketService>::close(ec_);
    typedef typename Protocol::resolver resolver_type;
    typedef typename resolver_type::query resolver_query;
    resolver_query query(x...);
    resolve_and_connect(query);
    return !ec_ ? this : 0;
  }
#else
  BOOST_PP_REPEAT_FROM_TO(
      1, BOOST_PP_INC(BOOST_ASIO_SOCKET_STREAMBUF_MAX_ARITY),
      BOOST_ASIO_PRIVATE_CONNECT_DEF, _ )
#endif

  /// Close the connection.
  /**
   * @return \c this if a connection was successfully established, a null
   * pointer otherwise.
   */
  basic_socket_streambuf<Protocol, StreamSocketService,
    Time, TimeTraits, TimerService>* close()
  {
    sync();
    this->basic_socket<Protocol, StreamSocketService>::close(ec_);
    if (!ec_)
      init_buffers();
Esempio n. 17
0
  NT2_DECLTYPE( dispatching ( Tag(), Site()                             \
                            , BOOST_PP_ENUM(n,M0,~)                     \
                            , adl_helper()                              \
                            )                                           \
              , type );                                                 \
};                                                                      \
/**/

namespace nt2 { namespace meta
{
  //==============================================================================
  // dispatch_call finds the proper call overload for evaluating a given
  // functor over a set of types on a given site
  //==============================================================================
  template<class Sig, class Site> struct dispatch_call; 
  BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_INC(NT2_MAX_ARITY),NT2_DISPATCH_CALL,~)

} }

#undef M0
#undef NT2_DISPATCH_TYPES_TPL
#undef NT2_DISPATCH_TYPES
#undef NT2_DISPATCH_CALL

#if defined(__WAVE__) && defined(NT2_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif

#endif
Esempio n. 18
0
                , (typename meta::hierarchy_of<Site>::type())                  \
                  BOOST_PP_REPEAT(n,M0,~)                                      \
                , adl_helper()                                                 \
                )                                                              \
  ) type;                                                                      \
};                                                                             \
/**/

namespace boost { namespace dispatch { namespace meta
{
  //==============================================================================
  // dispatch_call finds the proper call overload for evaluating a given
  // functor over a set of types on a given site
  //==============================================================================
  template<class Sig, class Site> struct dispatch_call; 
  BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_DISPATCH_MAX_ARITY),BOOST_DISPATCH_DISPATCH_CALL,~)

} } }

#undef M0
#undef BOOST_DISPATCH_DISPATCH_TYPES_TPL
#undef BOOST_DISPATCH_DISPATCH_TYPES
#undef BOOST_DISPATCH_DISPATCH_CALL

#if defined(__WAVE__) && defined(BOOST_DISPATCH_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif

#endif
Esempio n. 19
0
#include <cradle/preprocessor/config.hpp>
#include <cradle/preprocessor/va/for_each_i.hpp>

#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/debug/assert.hpp>


#define MACRO_3(R, SIZE, I, ELEM)                                          \
BOOST_PP_ASSERT(BOOST_PP_EQUAL(BOOST_PP_INC(BOOST_PP_ADD(I, ELEM)), SIZE)) \
  /**/

#define MACRO_2(SIZE, ...)                          \
CRADLE_PP_VA_FOR_EACH_I(MACRO_3, SIZE, __VA_ARGS__) \
  /**/

#define MACRO_1(Z, I, DATA) I

#define MACRO_0(Z, I, DATA)                                             \
MACRO_2(                                                                \
  I,                                                                    \
  CRADLE_PP_VA_REVERSE(BOOST_PP_CAT(BOOST_PP_ENUM_, Z)(I, MACRO_1, _))) \
  /**/

BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(CRADLE_PP_LIMIT_VA), MACRO_0, _)
Esempio n. 20
0
  /// @overload
  template<typename... Args> details::unspecified valmin(Args const&... dims);

  /// @overload
  template<typename ClassName> ClassName::type valmin(ClassName const& classname);

  /// @overload
  double valmin();

  #else

  #define M0(z,n,t)                                    \
  NT2_FUNCTION_IMPLEMENTATION(nt2::tag::Valmin,valmin, n) \
  /**/

  BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_INC(BOOST_PP_INC(NT2_MAX_DIMENSIONS)),M0,~)

  #undef M0

  #endif
}

namespace nt2 { namespace ext
{
  /// INTERNAL ONLY
  template<typename Domain, typename Expr, int N>
  struct  value_type<tag::Valmin,Domain,N,Expr>
        : meta::generative_value<Expr>
  {};

  /// INTERNAL ONLY
Esempio n. 21
0
#else

  #define N BOOST_PP_ITERATION()

  #define M0(z,n,txt) (A##n)
  #define M1(z,n,txt) (unspecified_<A##n>)
  #define M2(z,n,txt) nt2::run(boost::proto::child_c<BOOST_PP_INC(n)>(a0),p,t)

  NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::sub2ind_, tag::cpu_
                            , (SZ)BOOST_PP_REPEAT(N,M0,~)
                            , ((ast_<SZ,nt2::container::domain>))
                              BOOST_PP_REPEAT(N,M1,~)
                            )
  {
    BOOST_DISPATCH_RETURNS( BOOST_PP_INC(N)
                          , ( SZ const& sz
                            , BOOST_PP_ENUM_BINARY_PARAMS(N,A, const& a)
                            )
                          , ( nt2::sub2ind( nt2::as_size(sz)
                                          , BOOST_PP_ENUM_PARAMS(N,a)
                                          )
                            )
                          )
  };

  NT2_FUNCTOR_IMPLEMENTATION( nt2::tag::run_, tag::cpu_
                            , (A0)(State)(Data)
                            , ((node_ < A0, nt2::tag::sub2ind_
                                      , boost::mpl::long_<BOOST_PP_INC(N)>
                                      , nt2::container::domain