From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2007-08-10 07:49:47


On 8/9/07, shunsuke <pstade.mb_at_[hidden]> wrote:
> Marcus Lindblom wrote:
> > Please add a make_value_range() too, that uses the range-library (boost::begin &
> > boost::end).
>
> FWIW, oven(http://tinyurl.com/2axp2l) implemented that. :-)
>
> BOOST_FOREACH (string v, make_map_values(m)) {
> // ...
> }
>
> make_map_values(m) is synonym of make_elements<mpl::int_<1> >(m)
> that iterates over a range of FusionSequence.
>
> I agree no specific iterator is needed.
> make_elements is actually implemented using transform_iterator and a FunctionObject.
>
> Also note that Boost.Lambda can't be used here.
> A Boost.Lambda functor is not Assignable.
>

Yes, that is very unfortunate and I think it should be fixed.

I saw that oven uses a special wrapper to make boost.lambda objects
copiable. What does it exactly do?

The wrapper I use simply does a placement new in its assignment operator.
This is very exception unsafe, but I presume that most (all?) lambda
objects won't throw
on copy constructor. Using boost.optional would give the basic
exception safetly, but it does increase the size of the wrapper.

gpd