[Proto] Expression as fusion/MPL sequence

Seems somethign crooky on this front. Calling fusion::at_c on expression ends up in error even after including boost/proto/fusion.hpp. Same way, flatten used as a transform seems to not give me a type that can be passed to any fusion or mpl function. Looking at proto/fusion.hpp I noticed that the iterator is indeed random_access but not the view itself which as a forward_traversal tag. Even after fixing this, no dice, at_c<N>(some_proto_expr) still fails to compile.

On 6/2/2011 7:02 AM, Joel Falcou wrote:
Seems somethign crooky on this front. Calling fusion::at_c on expression ends up in error even after including boost/proto/fusion.hpp. Same way, flatten used as a transform seems to not give me a type that can be passed to any fusion or mpl function. Looking at proto/fusion.hpp I noticed that the iterator is indeed random_access but not the view itself which as a forward_traversal tag. Even after fixing this, no dice, at_c<N>(some_proto_expr) still fails to compile.
That's odd. Proto's fusion tests are passing on trunk and release, and the following program compiles for me (on trunk): #include <boost/proto/proto.hpp> #include <boost/fusion/include/at_c.hpp> namespace proto = boost::proto; namespace fusion = boost::fusion; int main() { proto::terminal<int>::type i = {42}; fusion::at_c<1>(i + i); } Can you post some code that demonstrates the problem? Proto expressions are random access, but flattened views are forward-only. That's a limitation of the current implementation of the segmented Fusion stuff. It's a known problem. Segmented fusion needs a complete rewrite, but it's a metaprogramming Everest, and I'm too tired to climb it again. Some hot-shot metaprogramming wunderkind should try cutting his/her teeth on that problem. They'd earn my eternal admiration and appreciation. -- Eric Niebler BoostPro Computing http://www.boostpro.com

On 01/06/11 22:24, Eric Niebler wrote:
Proto expressions are random access, but flattened views are forward-only. That's a limitation of the current implementation of the segmented Fusion stuff. It's a known problem. Segmented fusion needs a complete rewrite, but it's a metaprogramming Everest, and I'm too tired to climb it again. Some hot-shot metaprogramming wunderkind should try cutting his/her teeth on that problem. They'd earn my eternal admiration and appreciation.
Oh OK. So i may just need to *not* flatten them.

On 6/2/2011 11:12 AM, Joel falcou wrote:
On 01/06/11 22:24, Eric Niebler wrote:
Proto expressions are random access, but flattened views are forward-only. That's a limitation of the current implementation of the segmented Fusion stuff. It's a known problem. Segmented fusion needs a complete rewrite, but it's a metaprogramming Everest, and I'm too tired to climb it again. Some hot-shot metaprogramming wunderkind should try cutting his/her teeth on that problem. They'd earn my eternal admiration and appreciation.
Oh OK. So i may just need to *not* flatten them.
I just updated the docs to state that flatten returns a Fusion Forward Sequence. -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (3)
-
Eric Niebler
-
Joel falcou
-
Joel Falcou