Boost logo

Boost Users :

Subject: Re: [Boost-users] question about fusion concepts/documentation
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-05-29 19:00:56


On May 29, 2011, at 6:05 PM, Robert Ramey wrote:
> Expression Requirments
> ======================
> next(i)
> ...
>
> Meta Expressions
> ============
> result_of::next<I>::type
> ...
>
> Expression Semantics
> ===============
> next(i) - An iterator to the element following i
> ...
>
> So the quesion is: Why is result_of::next<I>::type necessary? The
> expression symantics
> only make sense if next(i) if it returns the same type as it's argument. So
> why is the
> result_of::next<I>::type needed at all. That is won't it always be equal to
> I. If not,
> why not?

That's exactly it - Fusion has compile-time heterogeneous sequences, so the elements will probably be of different types, and the incremented iterator is always of a different type.

This is something I need too, as I'm working on the proposed Fusion.Graph, so I need to define BGL-like concepts on top of Fusion concepts. I imagine you would look at how concepts are defined for metafunctions; I haven't looked at the Concept Check library. (Hoping that Matt Calabrese's proposed Boost.Generic will be up and running later this year!)

Cheers,
Gordon


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