Contains definition of the call<> transform.
Make the given CallableTransform into a PrimitiveTransform.
The purpose of proto::call<> is to annotate a transform as callable
so that proto::when<> knows
how to apply it. The template parameter must be either a PrimitiveTransform or a
CallableTransform; that is, a function type for which the return type is a callable
PolymorphicFunctionObject.
For the complete description of the behavior of the proto::call<>
transform, see the documentation for the nested
proto::call::impl<>
class template.
proto::transform< call<T> >
proto::transform_impl<Expr, State, Data>
see-below
In the description that follows, a type T is determined to model the
PrimitiveTransform concept if
proto::is_transform<T>::value is
true.
proto::call<T>::impl<Expr,State,Data>::result_type
is computed as follows:
If T if of the form
PrimitiveTransform or
PrimitiveTransform(), then
result_type is:
typename boost::result_of<PrimitiveTransform(Expr, State, Data)>::type
If T is of the form
PrimitiveTransform(A0), then
result_type is:
typename boost::result_of<PrimitiveTransform(
typename boost::result_of<when<_,A0>(Expr, State, Data)>::type,
State,
Data
)>::type
If T is of the form
PrimitiveTransform(A0, A1), then
result_type is:
typename boost::result_of<PrimitiveTransform(
typename boost::result_of<when<_,A0>(Expr, State, Data)>::type,
typename boost::result_of<when<_,A1>(Expr, State, Data)>::type,
Data
)>::type
If T is of the form
PrimitiveTransform(A0, A1, A2), then
result_type is:
typename boost::result_of<PrimitiveTransform(
typename boost::result_of<when<_,A0>(Expr, State, Data)>::type,
typename boost::result_of<when<_,A1>(Expr, State, Data)>::type,
typename boost::result_of<when<_,A2>(Expr, State, Data)>::type
)>::type
If T is of the form
PolymorphicFunctionObject(A0,…An), then
result_type is:
typename boost::result_of<PolymorphicFunctionObject(
typename boost::result_of<when<_,A0>(Expr, State, Data)>::type,
…
typename boost::result_of<when<_,An>(Expr, State, Data)>::type
>::type
If T is of the form
PolymorphicFunctionObject(A0,…An ...), then
let T' be PolymorphicFunctionObject(A0,…An-1, S),
where S is a type sequence computed from the unpacking expression An
as described in the reference for proto::pack.
Then, result_type is:
typename proto::call<T'>::impl<Expr,State,Data>::result_type
result_type
typename impl::expr_param
typename impl::state_param
typename impl::data_param
In the description that follows, a type T is determined to model the
PrimitiveTransform concept if
proto::is_transform<T>::value is
true.
proto::call<T>::impl<Expr,State,Data>::operator() behaves as follows:
If T if of the form
PrimitiveTransform or
PrimitiveTransform(), then
return
PrimitiveTransform()(expr, state, data)
If T is of the form
PrimitiveTransform(A0), then
return
PrimitiveTransform()(
when<_,A0>()(expr, state, data),
state,
sata
)
If T is of the form
PrimitiveTransform(A0, A1), then
return:
PrimitiveTransform()(
when<_,A0>()(expr, state, data),
when<_,A1>()(expr, state, data),
Data
)
If T is of the form
PrimitiveTransform(A0, A1, A2), then
return
PrimitiveTransform()(
when<_,A0>()(expr, state, data),
when<_,A1>()(expr, state, data),
when<_,A2>()(expr, state, data)
)
If T is of the form
PolymorphicFunctionObject(A0,…An), then
return:
PolymorphicFunctionObject()(
when<_,A0>()(expr, state, data),
...
when<_,An>()(expr, state, data)
)
If T is of the form
PolymorphicFunctionObject(A0,…An ...), then
let T' be PolymorphicFunctionObject(A0,…An-1, S),
where S is a type sequence computed from the unpacking expression An
as described in the reference for proto::pack.
Then, return:
proto::call<T'>()(expr, state, data)