Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-07-21 21:05:29


Ronald Garcia wrote:
> This sounds great to me. I am very curious to see what work you have
> done. I'm not familiar with the languages you have mentioned, but I
> understand that the STL was designed based upon previous work done in
> scheme. Carrying these ideas over to template metaprogramming is very
> fitting.

That's what 'boost::mpl' library does :), see
http://groups.yahoo.com/group/boost/files/mpl/. As far as I understand, Vesa
is advocating pure functional approach to implementing metaprogramming
algorithms/collections/utility functions framework - no state, no iterators,
recursion instead of iteration, etc. In some sense, it fits the C++
metaprogramming model better than "traditional" generic programming (STL)
style. I believe that both models have their place, and that we can benefit
from each other work.

> your foldr sounds a lot like std::accumulate in the STL world, but
> applied to template metaprograms.

'accumulate' in 'boost::mpl' looks like, well, accumulate:

mpl::accumulate< value_list<0, 1, 2, 3>, int_value<0> >::value

or, with explicit 'add' metafunction,

mpl::accumulate< value_list<0, 1, 2, 3>, int_value<0>, add >::value

Aleksey


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