Boost logo

Proto :

Subject: [proto] unpack transform (was: : Proto transform with state)
From: Eric Niebler (eric_at_[hidden])
Date: 2010-11-18 12:46:03


On 11/18/2010 3:58 AM, Thomas Heller wrote:
> Btw, i just finished implementing the unpack feature we were talking about

Awesome!

> ...
> Short description:
>
> Calling some_callable with the expression unpacked:
> proto::when<proto::_, some_callable(unpack)>
>
> Calling some_callable with an arbitrary sequence unpacked:
> proto::when<proto::_, some_callable(unpack(some_fusion_seq())>
>
> Calling some_callable with an arbitrary sequence unpacked, and apply a proto
> transform before:
> proto::when<proto::_, some_callable(unpack(some_fusion_seq(),
> some_transform)>

Perfect.

> Additionally it is possible to have arbitrary parameters before or after
> unpack.

Whoa. You said that was going to be impossible or very expensive. I'[m
impressed.

> The implementation is located at:
> http://svn.boost.org/svn/boost/sandbox/SOC/2010/phoenix3/boost/phoenix/core/unpack.hpp
>
> Just a whole mess of preprocessor generation ... this is not really fast to
> compile at the moment, PROTO_MAX_ARITY of 5 is fine, everything above will
> just blow the compiler :(

That's a bit worrying. When I have some time, I'll try to grok your work
and see if there's any way to speed things up.

Thanks for your work on this!

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Proto list run by eric at boostpro.com