Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] [range] range::erase vs. fusion::erase
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-09-17 15:56:57


> From: mr.chr.schmidt_at_[hidden]
> To: boost-users_at_[hidden]
> Date: Sat, 17 Sep 2011 09:16:03 +0200
> Subject: Re: [Boost-users] [fusion] [range] range::erase vs. fusion::erase
>
> Nathan Ridge <zeratul976_at_[hidden]> writes:
>
> > Hi,
> >
> > I have an std::vector<S> and I use boost::erase() from Boost.Range on it.
> >
> > Now I changed S to be a Fusion sequence type, and as a result,
> > boost::fusion::erase() is being found by ADL and called instead of
> > boost::range::erase().
> >
> > Which of course gives all kinds of errors because std::vector is not a Fusion
> > sequence.
> >
> > Is there a way to avoid this, besides qualifying every call to boost::erase()
> > as boost::range::erase()? Basically I want to disable the finding of
> > boost::fusion:: algorithms by ADL.
> >
> > Thanks,
> > Nate
>
> There is no easy fix. We'd need ADL barriers in fusion, which
> themselves impose limitations. Have a look at
>
> https://svn.boost.org/trac/boost/ticket/4028
>
> for more information.

The solution I suggested on the Boost-Spirit list was to use SFINAE
to disable the boost::fusion:: algorithms for types that are not
Fusion sequences.

This would solve the issue for many types, but not all (for example,
boost::array/std::array is both a Fusion sequence and a range).

Nate
                                               


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