Boost logo

Boost :

Subject: Re: [boost] [Fusion] Tentative of trasnform_if failed :(
From: Christopher Schmidt (mr.chr.schmidt_at_[hidden])
Date: 2011-04-19 14:57:52


falcou <Joel.Falcou_at_[hidden]> writes:

> The following code
>
> http://ideone.com/xYk4X
>
> doesn't compile and i cant get the why of it.
>
> The goal is to have a fusion transform_if that takes a compile-time
> predicates
> For each element int he sequence, if the predicates its true, we apply
> some
> transform on it, if not we return the element unchanged.
>
> What am I missing ?

The MPL lambda template type parameter of the functor that is passed to
Fusion causes the trouble. This functor is used by Fusion as a template
type parameter for an internal metafunction class which turns into an
(invalid) lambda expression due to the nested placeholder. Making
'preds' a metafunction class, e.g. via mpl::quote1, should make your
code compile fine.

-Christopher


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