Boost logo

Boost Users :

Subject: Re: [Boost-users] [range] joining ranges with different value types, then transforming with a polymorphic functor
From: Neil Groves (neil_at_[hidden])
Date: 2011-02-27 17:04:18


>
> Is there a way to do this?
>
>
You cannot join ranges of unrelated types. I can't imagine how this would
work with unrelated types as in your example. What would you expect the
resultant range from the join function to have for the value_type and
reference type?

You should however be able to do this:
BOOST_FOREACH(const C c, join(a | transformed(to_C()), b |
transforms(to_C()))
{
    // do something
}

> Thanks,
> Nate.
>

Does this idiom work for your real world example?

Neil Groves



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net