本文整理匯總了C++中BOOST_PP_INC函數的典型用法代碼示例。如果您正苦於以下問題:C++ BOOST_PP_INC函數的具體用法?C++ BOOST_PP_INC怎麽用?C++ BOOST_PP_INC使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BOOST_PP_INC函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: defined
{};
#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
示例2: BOOST_PP_REPEAT_FROM_TO
{
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)
示例3: sign_t
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);
}
示例4: tie
{
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),
示例5: BOOST_PP_ITERATION
// 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)>
示例6: function_equal_
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
示例7: serialize
}
//
// 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
示例8: operator
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
示例9: BOOST_PP_REPEAT
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) \
示例10: BOOST_PP_ITERATION_DEPTH
#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) >
示例11: base_from_member
// 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
示例12: BOOST_PP_REPEAT
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;
示例13: defined
#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
示例14: BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP
#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
示例15: defined
#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();