Boost logo

Boost :

Subject: Re: [boost] [MP11] Loosing const-qualification on type result with GCC 4.8 only
From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2019-04-28 08:20:58


Hi Mateusz, Peter,

On Sat, Apr 27, 2019 at 10:32 PM Mateusz Loskot via Boost <
boost_at_[hidden]> wrote:

> On 19-04-26 01:05:12, Mateusz Loskot wrote:
> >
> >(initially posted to
> https://lists.boost.org/boost-users/2019/04/89778.php)
> >
> >I prepared a lenghty MWE which reproduces my problem with
> >type manipulation using MP11 that for some reason looses
> >const-qualification on a ::type result
> [...]

https://github.com/boostorg/mp11/blob/e5d6e0d0b991a99c71a2b8f5057d0f0a1a89e060/test/mp_quote_trait.cpp#L47-L54
> #if
> <https://github.com/boostorg/mp11/blob/e5d6e0d0b991a99c71a2b8f5057d0f0a1a89e060/test/mp_quote_trait.cpp#L47-L54%23if>
> !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 40900 )
> // g++ 4.7, 4.8 have difficulties with preserving top-level const
> BOOST_TEST_TRAIT_TRUE((std::is_same<mp_invoke_q<Q, void>, void
> const>));
> BOOST_TEST_TRAIT_TRUE((std::is_same<mp_invoke_q<Q, int[]>, int
> const[]>));
> #endif
>
> Since GCC 4.8 is dying, it's a good idea to stop using it
> where MP11 + C++11 is required.

how about wrapping the const type in mp_identity as a workaround before
doing transforms, and then unwrapping?


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