Merged revisions 58392 via svnmerge from
https://svn.boost.org/svn/boost/trunk ........ r58392 | eric_niebler | 2009-12-15 17:59:30 +1300 (Tue, 15 Dec 2009) | 1 line fix docs for fold transform, misc doc and code clean-up ........ [SVN r58393]
This commit is contained in:
parent
c052fcff9f
commit
195a2d4a1b
@ -287,8 +287,8 @@ struct IsIntegral2 :
|
||||
When applying
|
||||
<computeroutput>proto::or_<G<subscript>0</subscript>,G<subscript>1</subscript>,...G<subscript>n</subscript>></computeroutput>
|
||||
as a transform with an expression <computeroutput>e</computeroutput> of type <computeroutput>E</computeroutput>,
|
||||
state <computeroutput>s</computeroutput> and data <computeroutput>v</computeroutput>, it is equivalent to
|
||||
<computeroutput>G<subscript>x</subscript>()(e, s, v)</computeroutput>, where
|
||||
state <computeroutput>s</computeroutput> and data <computeroutput>d</computeroutput>, it is equivalent to
|
||||
<computeroutput>G<subscript>x</subscript>()(e, s, d)</computeroutput>, where
|
||||
<computeroutput>x</computeroutput> is the lowest number such that
|
||||
<computeroutput><classname>proto::matches</classname><E, G<subscript>x</subscript>>::value</computeroutput>
|
||||
is <computeroutput>true</computeroutput>.
|
||||
@ -370,8 +370,8 @@ struct IsIntegral2 :
|
||||
When applying
|
||||
<computeroutput>proto::and_<G<subscript>0</subscript>,G<subscript>1</subscript>,...G<subscript>n</subscript>></computeroutput>
|
||||
as a transform with an expression <computeroutput>e</computeroutput>, state
|
||||
<computeroutput>s</computeroutput> and data <computeroutput>v</computeroutput>, it is equivalent
|
||||
to <computeroutput>G<subscript>n</subscript>()(e, s, v)</computeroutput>.
|
||||
<computeroutput>s</computeroutput> and data <computeroutput>d</computeroutput>, it is equivalent
|
||||
to <computeroutput>G<subscript>n</subscript>()(e, s, d)</computeroutput>.
|
||||
</para>
|
||||
<para>
|
||||
The maximun number of template arguments <computeroutput>proto::and_<></computeroutput> accepts
|
||||
@ -444,8 +444,8 @@ struct IsIntegral2 :
|
||||
When applying <computeroutput>proto::switch_<C></computeroutput> as a transform
|
||||
with an expression <computeroutput>e</computeroutput> of type
|
||||
<computeroutput>E</computeroutput>, state <computeroutput>s</computeroutput> and
|
||||
data <computeroutput>v</computeroutput>, it is equivalent to
|
||||
<computeroutput>C::case_<E::proto_tag>()(e, s, v)</computeroutput>.
|
||||
data <computeroutput>d</computeroutput>, it is equivalent to
|
||||
<computeroutput>C::case_<E::proto_tag>()(e, s, d)</computeroutput>.
|
||||
</para>
|
||||
</description>
|
||||
<struct name="impl">
|
||||
@ -517,7 +517,7 @@ struct IsIntegral2 :
|
||||
</para>
|
||||
<para>For example:</para>
|
||||
<para>
|
||||
<programlisting>// Match any function call expression, irregardless
|
||||
<programlisting>// Match any function call expression, regardless
|
||||
// of the number of function arguments:
|
||||
struct Function :
|
||||
<classname>proto::function</classname>< proto::vararg<proto::_> >
|
||||
|
@ -52,7 +52,7 @@
|
||||
<type>typename boost::result_of<Y(Expr, State, Data)>::type</type>
|
||||
</typedef>
|
||||
<typedef name="fun">
|
||||
<purpose><computeroutput>fun(v)(e,s) == when<_,Fun>()(e,s,v)</computeroutput></purpose>
|
||||
<purpose><computeroutput>fun(d)(s,e) == when<_,Fun>()(e,s,d)</computeroutput></purpose>
|
||||
<type><emphasis>unspecified</emphasis></type>
|
||||
</typedef>
|
||||
<typedef name="result_type">
|
||||
@ -86,7 +86,7 @@
|
||||
let <computeroutput>state0</computeroutput> be
|
||||
<computeroutput><classname>when</classname><<classname>_</classname>, State0>()(expr, state, data)</computeroutput>,
|
||||
and let <computeroutput>fun(data)</computeroutput> be an object such that
|
||||
<computeroutput>fun(data)(expr, state)</computeroutput> is equivalent to
|
||||
<computeroutput>fun(data)(state, expr)</computeroutput> is equivalent to
|
||||
<computeroutput><classname>when</classname><<classname>_</classname>, Fun>()(expr, state, data)</computeroutput>. Then,
|
||||
this function returns <computeroutput>fusion::fold(seq, state0, fun(data))</computeroutput>.
|
||||
</para>
|
||||
|
@ -48,8 +48,8 @@ struct CountLeaves :
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<computeroutput>proto::when<G,T>()(e,s,v)</computeroutput> is the same as
|
||||
<computeroutput>T()(e,s,v)</computeroutput>.
|
||||
<computeroutput>proto::when<G,T>()(e,s,d)</computeroutput> is the same as
|
||||
<computeroutput>T()(e,s,d)</computeroutput>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -725,8 +725,8 @@
|
||||
/// matches any \c Bx for \c x in <tt>[0,n)</tt>.
|
||||
///
|
||||
/// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an
|
||||
/// expression \c e of type \c E, state \c s and data \c v, it is
|
||||
/// equivalent to <tt>Bx()(e, s, v)</tt>, where \c x is the lowest
|
||||
/// expression \c e of type \c E, state \c s and data \c d, it is
|
||||
/// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest
|
||||
/// number such that <tt>matches\<E,Bx\>::::value</tt> is \c true.
|
||||
template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
|
||||
struct or_ : transform<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
|
||||
@ -761,8 +761,8 @@
|
||||
/// matches all \c Bx for \c x in <tt>[0,n)</tt>.
|
||||
///
|
||||
/// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an
|
||||
/// expression \c e, state \c s and data \c v, it is
|
||||
/// equivalent to <tt>Bn()(e, s, v)</tt>.
|
||||
/// expression \c e, state \c s and data \c d, it is
|
||||
/// equivalent to <tt>Bn()(e, s, d)</tt>.
|
||||
template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
|
||||
struct and_ : transform<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
|
||||
{
|
||||
@ -795,8 +795,8 @@
|
||||
/// matches <tt>C::case_\<E::proto_tag\></tt>.
|
||||
///
|
||||
/// When applying <tt>switch_\<C\></tt> as a transform with an
|
||||
/// expression \c e of type \c E, state \c s and data \c v, it is
|
||||
/// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, v)</tt>.
|
||||
/// expression \c e of type \c E, state \c s and data \c d, it is
|
||||
/// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, d)</tt>.
|
||||
template<typename Cases>
|
||||
struct switch_ : transform<switch_<Cases> >
|
||||
{
|
||||
|
@ -30,8 +30,8 @@
|
||||
template<typename Transform, typename Data>
|
||||
struct as_callable
|
||||
{
|
||||
as_callable(Data v)
|
||||
: v_(v)
|
||||
as_callable(Data d)
|
||||
: d_(d)
|
||||
{}
|
||||
|
||||
template<typename Sig>
|
||||
@ -51,7 +51,7 @@
|
||||
typename when<_, Transform>::template impl<Expr &, State const &, Data>::result_type
|
||||
operator ()(State const &s, Expr &e) const
|
||||
{
|
||||
return typename when<_, Transform>::template impl<Expr &, State const &, Data>()(e, s, this->v_);
|
||||
return typename when<_, Transform>::template impl<Expr &, State const &, Data>()(e, s, this->d_);
|
||||
}
|
||||
|
||||
#else
|
||||
@ -74,7 +74,7 @@
|
||||
#endif
|
||||
|
||||
private:
|
||||
Data v_;
|
||||
Data d_;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -190,7 +190,7 @@
|
||||
>::type
|
||||
state0;
|
||||
|
||||
/// \brief <tt>fun(v)(e,s) == when\<_,Fun\>()(e,s,v)</tt>
|
||||
/// \brief <tt>fun(d)(e,s) == when\<_,Fun\>()(e,s,d)</tt>
|
||||
typedef
|
||||
detail::as_callable<Fun, Data>
|
||||
fun;
|
||||
|
@ -49,8 +49,8 @@
|
||||
/// <tt>boost::result_of\<when\<G,T\>(E,S,V)\>::::type</tt> is the same as
|
||||
/// <tt>boost::result_of\<T(E,S,V)\>::::type</tt>.
|
||||
///
|
||||
/// <tt>when\<G,T\>()(e,s,v)</tt> is the same as
|
||||
/// <tt>T()(e,s,v)</tt>.
|
||||
/// <tt>when\<G,T\>()(e,s,d)</tt> is the same as
|
||||
/// <tt>T()(e,s,d)</tt>.
|
||||
template<typename Grammar, typename PrimitiveTransform /*= Grammar*/>
|
||||
struct when
|
||||
: PrimitiveTransform
|
||||
|
Loading…
Reference in New Issue
Block a user