Boost logo

Boost :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2008-03-10 12:38:07


Steven Watanabe <watanabesj <at> gmail.com> writes:

>
> AMDG
>
> Markus Werle wrote:

> > Sorry if I do not get that one.
> >
>
> The definition of expr is something like:
>
> template<class Tag, class Args, int Arity = Args::arity>
> struct expr;
>
> template<class Tag, class Args>
> struct expr<Tag, Args, 0> {
> typename Args::arg0 arg0;
> };
> template<class Tag, class Args>
> struct expr<Tag, Args, 1> {
> typename Args::arg0 arg0;
> };
> template<class Tag, class Args>
> struct expr<Tag, Args, 2> {
> typename Args::arg0 arg0;
> typename Args::arg1 arg1;
> };
>

OK, and what is the advantage of the 3rd template argument Arity then?
AFAICS this is needed for the BOOST_PP_ITERATION magic, but strictly speaking
it is not necessary for the data _representation_, right?

Also I feel very uncomfortable about those typedefs above ...
can't we get along accessing by index when in need for it?
 

Markus


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk