本文整理匯總了C++中BOOST_PP_ENUM_PARAMS函數的典型用法代碼示例。如果您正苦於以下問題:C++ BOOST_PP_ENUM_PARAMS函數的具體用法?C++ BOOST_PP_ENUM_PARAMS怎麽用?C++ BOOST_PP_ENUM_PARAMS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BOOST_PP_ENUM_PARAMS函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: operator
R operator()(
BOOST_PP_ENUM_BINARY_PARAMS(MOCK_NUM_ARGS, T, t) ) const
{
valid_ = false;
for( expectations_cit it = expectations_.begin();
it != expectations_.end(); ++it )
if( it->is_valid(
BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, t) ) )
{
if( ! it->invoke() )
{
error_type::fail( "sequence failed",
MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
return error_type::abort();
}
if( ! it->functor() )
{
error_type::fail( "missing action",
MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
return error_type::abort();
}
valid_ = true;
error_type::call(
MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
return it->functor()(
BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, t) );
}
error_type::fail( "unexpected call", MOCK_FUNCTION_CONTEXT );
return error_type::abort();
}
示例2: dispatch_sync
inline saga::task
dispatch_sync (run_mode mode,
char const * name,
TR1::shared_ptr<v1_0::cpi> cpi_instance,
void (Base::*sync ) (RetVal &, BOOST_PP_ENUM_PARAMS (K, FuncArg)),
saga::task (Base::*async) ( BOOST_PP_ENUM_PARAMS (K, FuncArg)),
BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg))
{
TR1::shared_ptr<Base> c = TR1::static_pointer_cast<Base>(cpi_instance);
switch (mode) {
case Sync_Sync:
return sync_sync(c, sync, BOOST_PP_ENUM_PARAMS(K, arg));
case Sync_Async:
return sync_async(c, async, BOOST_PP_ENUM_PARAMS(K, arg));
case Async_Sync:
case Async_Async:
BOOST_ASSERT(false);
break;
default:
break;
}
// no adaptor found (Invalid mode)!
SAGA_THROW_VERBATIM(cpi_instance.get(),
std::string ("No adaptor implements method: ") + name,
adaptors::NoAdaptor);
return saga::task(saga::task_base::Done);
}
示例3: operator
typename lazy_enable_if_c<
(mpl::size<param_types>::value == N)
, make_nonterminal_holder<
parameterized_nonterminal<
Derived
, fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>
>
, Derived
>
>::type
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& f)) const
{
typename
make_nonterminal_holder<
parameterized_nonterminal<
Derived
, fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>
>
, Derived
>::type
result =
{{
static_cast<Derived const*>(this)
, fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>(
BOOST_PP_ENUM_PARAMS(N, f))
}};
return result;
}
示例4: emplace_alert
void emplace_alert(BOOST_PP_ENUM_BINARY_PARAMS(I, A, const& a) )
{
mutex::scoped_lock lock(m_mutex);
#ifndef TORRENT_NO_DEPRECATE
if (m_dispatch)
{
m_dispatch(std::auto_ptr<alert>(new T(m_allocations[m_generation]
BOOST_PP_COMMA_IF(I)
BOOST_PP_ENUM_PARAMS(I, a))));
return;
}
#endif
// don't add more than this number of alerts, unless it's a
// high priority alert, in which case we try harder to deliver it
// for high priority alerts, double the upper limit
if (m_alerts[m_generation].size() >= m_queue_size_limit
* (1 + T::priority))
return;
T alert(m_allocations[m_generation]
BOOST_PP_COMMA_IF(I)
BOOST_PP_ENUM_PARAMS(I, a));
m_alerts[m_generation].push_back(alert);
maybe_notify(&alert, lock);
}
示例5: construct_instance
static instance construct_instance(BOOST_PP_ENUM_BINARY_PARAMS(N, Param, p)) {
// An instance is similar to boost::any. Initialize it with
// a void ptr.
return instance(static_cast<void*>(
construct<T BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, Param)>
(BOOST_PP_ENUM_PARAMS(N, p))),
&destruct<T>);
}
示例6: compare_not_equal
bool operator!=( of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D1)> const& a0
, of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D2)> const& a1
)
{
static const std::size_t
a = of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D1)>::static_size;
static const std::size_t
b = of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D2)>::static_size;
return details::compare_not_equal(a0,a1,boost::mpl::size_t<(a < b) ? b : a>());
}
示例7: dispatch_async
inline saga::task
dispatch_async (proxy * prxy,
TR1::shared_ptr <adaptor_selector_state> state,
void (Base::*sync_) (RetVal &, BOOST_PP_ENUM_PARAMS (K, FuncArg)),
saga::task (Base::*async_) ( BOOST_PP_ENUM_PARAMS (K, FuncArg)),
BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg),
bool (Base::*prep_) (RetVal &, BOOST_PP_ENUM_PARAMS(K, FuncArg), saga::uuid) = NULL)
{
typedef void (Base::*sync_func )(RetVal&, BOOST_PP_ENUM_PARAMS(K, FuncArg));
typedef saga::task (Base::*async_func)( BOOST_PP_ENUM_PARAMS(K, FuncArg));
typedef bool (Base::*prep_func )(RetVal&, BOOST_PP_ENUM_PARAMS(K, FuncArg), saga::uuid);
void (Base::*sync )() = NULL;
saga::task (Base::*async)() = NULL;
bool (Base::*prep )() = NULL;
run_mode mode = Unknown;
TR1::shared_ptr<Base> c (
state->get_next_cpi (mode, &sync, &async, &prep));
// BOOST_ASSERT(NULL == sync || (sync_func) sync == sync_ );
// BOOST_ASSERT(NULL == async || (async_func) async == async_);
// BOOST_ASSERT(NULL == prep || (prep_func) prep == prep_ );
switch (mode) {
case Async_Sync:
BOOST_ASSERT(sync);
return async_sync(prxy, c, state, (sync_func)sync,
BOOST_PP_ENUM_PARAMS(K, arg), (prep_func)prep);
case Async_Async:
BOOST_ASSERT(async);
return async_async(c, state, (async_func)async,
BOOST_PP_ENUM_PARAMS(K, arg));
case Sync_Sync:
case Sync_Async:
BOOST_ASSERT(false);
break;
default:
break;
}
// no adaptor found (Invalid mode)!
SAGA_THROW_VERBATIM(c.get(),
std::string ("No adaptor implements method: ") + state->get_op_name(),
adaptors::NoAdaptor);
// this makes some compilers happy, but will never be called in fact
// (didn't you see the throw above?)
return saga::task(saga::task_base::Done);
}
示例8: operator
R operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, Arg, arg))
{
BOOST_SQL_RESULT_TYPE result;
impl->execute(BOOST_SQL_PARAM_TYPE(BOOST_PP_ENUM_PARAMS(N, arg)));
impl->fetch(result);
return make_result<R, BOOST_SQL_RESULT_TYPE>::call(result);
}
示例9: def
void def(std::string const &name, R (*f)(BOOST_PP_ENUM_PARAMS(n,T)),
policies const &p = policies())
{
add_function(name,
boost::shared_ptr<details::callback_base>(
new details::BOOST_PP_CAT(callback,n)<R BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n,T)>(f)), p);
}
示例10: call
BOOST_FORCEINLINE
static type const call(src_type const &e)
{
type that = {
BOOST_PP_ENUM_PARAMS(N, e.child)
};
return that;
}
示例11: create
/** Returns an instance of T (but does NOT retain ownership of the instance).
* \param Params... The parameters described in the type of this factory.
* \return An instance of T.
* \pre is_valid() == true.
* \post None.
*/
T* create(Params...) const {
if (this->func) {
return this->func(BOOST_PP_ENUM_PARAMS(N, p));
}
else {
return 0;
}
}
示例12: sync_async
inline saga::task
sync_async (TR1::shared_ptr <Cpi> cpi,
saga::task (Base::*async)(BOOST_PP_ENUM_PARAMS (K, FuncArg)),
BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg))
{
return saga::detail::run_wait(
(cpi.get()->*async)(BOOST_PP_ENUM_PARAMS(K, arg)));
}
示例13: create
T* create(BOOST_PP_ENUM_BINARY_PARAMS(N, Param, p)) const {
if (this->func) {
return this->func(BOOST_PP_ENUM_PARAMS(N, p));
}
else {
return 0;
}
}
示例14: generate
inline bool
generate(
OutputIterator const& sink_
, Expr const& expr
, BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
{
OutputIterator sink = sink_;
return karma::generate(sink, expr, BOOST_PP_ENUM_PARAMS(N, attr));
}
示例15: operator
void operator()
(BOOST_PP_ENUM
(BOOST_COROUTINE_ARG_MAX,
BOOST_COROUTINE_param_with_default,
arg)) {
m_future_pimpl->assign(tuple_type
(BOOST_PP_ENUM_PARAMS
(BOOST_COROUTINE_ARG_MAX, arg)));
}