Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-07-31 17:41:55


On Thu, 1 Aug 2002, Aleksey Gurtovoy wrote:
agurto> Jeremy Siek wrote:
agurto>
agurto> > Can I write recursive lisp-style meta algorithms using MPL list (or any
agurto> > MPL class).
agurto>
agurto> Depends on what do you mean by "lisp-style" :). Is this one Lisp-ish enough?
agurto>
agurto> template< typename Iter, typename End >
agurto> struct size
agurto> {
agurto> enum { value = 1 + size< typename Iter::next, End >::value };
agurto> };
agurto>
agurto> template< typename End >
agurto> struct size<End,End>
agurto> {
agurto> enum { value = 0 };
agurto> };
agurto>
agurto> If not, what in particular is "non-conforming"?

So far so good, but the example is not yet complete. Can I see the above
size algorithm applied.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


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