Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] remove_if and as_vector with Placeholder Expression as predicate
From: Joel de Guzman (djowel_at_[hidden])
Date: 2012-11-14 18:58:39


On 11/13/12 1:11 AM, Felipe Magno de Almeida wrote:
> Hello,
>
> I'm trying to remove_if a few elements from a fusion sequence. But it
> is instantiating
> my predicate with the placeholder from MPL later on. Including with as_vector.
>
> The following code generates the error code I'm pasting by the end of
> the message.
> I'm using GCC 4.7.2 and Linux x86_64. If I wrap meta_func<mpl::_1> in
> a mpl::lambda<>::type
> then the errors following the first error messages is what I get. I'm
> not sure if I'm doing
> something wrong here. If anyone could please shed some light, I would
> really appreciate it.
>
> #include <boost/fusion/include/as_vector.hpp>
> #include <boost/fusion/include/remove_if.hpp>
>
> namespace mpl = boost::mpl;
> namespace fusion = boost::fusion;
>
> struct element
> {
> typedef mpl::false_ type;
> };
>
> template <typename T>
> struct meta_func
> {
> typedef typename T::type type;
> };
>
> int main()
> {
> fusion::vector<element, element> e;
> fusion::as_vector(fusion::remove_if<meta_func<mpl::_1> >(e));
> }

I've been noticing something similar recently only with GCC.
I haven't tracked the problem yet. I'm not sure if it's a Fusion,
MPL or GCC problem. Could you please add a trac ticket for this?

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

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