Boost logo

Boost :

Subject: Re: [boost] [type_traits][parameter] Inconsistent boost::is_convertible between gcc and clang
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2012-08-12 16:50:30

On 11/08/12 21:26, Lorenzo Caminiti wrote:
> On Wed, Aug 8, 2012 at 8:59 PM, John Bytheway <jbytheway+boost_at_[hidden]> wrote:
>> I have been tracking down an issue with some of my code which compiles
>> fine with gcc but not clang. It manifested as a failure in
>> Boost.Parameter but I eventually pinned it down to an inconsistency in
>> the behaviour of boost::is_convertible. The following program
> For curiosity, when using Boost.Parameter what error did you see?
> (Even if I understand the error was ultimately not there.)

I've investigated further and am less sure that it was Boost.Parameter's
fault. I attach my test case.

In particular:

        (in_out(tag_1), (A&))

On closer reading of the Boost.Parameter docs I guess it is probably not
allowed to pass a reference type as an type requirement, although again
it's not entirely clear.

I guess (not sure) that when I first wrote this code I used A in place
of A&, which fails because A is non-moveable, and when Boost.Parameter
checks is_convertible<A,A>, which is false, it thinks that the call is
not a match.

With the implementation of is_convertible at that time, switching to A&
made everything work, because then it was checking is_convertible<A,A&>,
which was true.

Now my workaround no longer works, and I wonder: what is the proper way
to capture a reference to a non-moveable type in a Boost.Parameter
argument? Perhaps the A& technique I used is supposed to work but no
longer does because of the changed meaning of boost::is_convertible
after Boost 1.46 (as mentioned by Michel elsewhere)?


Boost list run by bdawes at, gregod at, cpdaniel at, john at