Boost logo

Boost :

From: Dean Michael C. Berris (dmberris_at_[hidden])
Date: 2007-09-24 04:22:09


> -----Original Message-----
> From: spirit-devel-bounces_at_[hidden] [mailto:spirit-devel-
> bounces_at_[hidden]] On Behalf Of Joel de Guzman
> Sent: Monday, September 24, 2007 1:18 AM
> To: spirit-devel_at_[hidden]
> Cc: boost_at_[hidden]
> Subject: Re: [Spirit-devel] [fusion] Short-circuited Exception-based
> ViewIteration
>
> Dean Michael Berris wrote:
> >
> > This makes sense, though there might be a possibility where a
> > homogeneous tuple would be able to return just a single value:
> >
> > struct equals_2 {
> > template <typename T>
> > T operator() (T element) const {
> > if (element == 2) return element;
> > };
> > };
> >
> > typedef fusion::tuple<int, int, int> point_type;
> > point_type point(1, 2, 3);
> > assert(fusion::is_homogenous<point_type>::value == true);
> > assert(fusion::find_first_if<equals_2>(point) == 2); // only works
if
> > 'point' is a homogeneous container
>
> If that was the case, I'd use boost::array which is a nice data
structure
> that has a special property: it is *both* a fusion sequence *and* an
stl
> sequence.
>

Brilliant!

I think that solves my predicament! :D

> Regards,

Thank you very much!

--
Dean Michael Berris
<dmberris_at_[hidden]>
Mobile: +639287291459
YMID: mikhailberis

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