Boost logo

Boost :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2008-03-10 06:25:54


Hi!

I want to discuss the internal data structure expr<>:

I like the way expr<> is built regarding to the first and second
template argument: It is well thought and done to have the
expression tag as first argument and some fusion-compatible
typelist as its second argument containing the operands.

OTOH the third template argument contains redundant information:
The docs say: "Proto expression nodes are valid Fusion random-access
sequences of their children nodes."
So the information about the number of arguments is accessible via
some size<T>::type metafunction e.g. depending on

result_of::distance<result_of::begin<S>::type
                result_of::end<S>::type>::type?

In my unfinished attempts to write a paper about ET library design
(now obsolote, thanks to Eric) I have a statement that any expression
representation taking more than 2 template arguments is wrong.

Eric, since you always have a good reason for your design:
Could you please elaborate on this?

Also I ask myself whether there was a good reason not to follow
mpl and use types to represent numbers.
I'd prefer at least some parallism to mpl here: size_t<c>?

Markus


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