Boost logo

Boost :

Subject: Re: [boost] [MP11] Loosing const-qualification on type result with GCC 4.8 only
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2019-04-28 15:42:54


O 19-04-28 10:20:58, Hans Dembinski wrote:
>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
>> !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?

As we discussed on Slack, it may work.
I'm just not able, resource-wise, to maintain support
for GCC 4.8 or similarly ancient compiler in GIL.
Anyone who wishes to use GIL with such the oldies is welcome
to submit PR. Alternatively, older Boost versions are available.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Fingerprint=C081 EA1B 4AFB 7C19 38BA  9C88 928D 7C2A BB2A C1F2

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