
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
Here it is at https://godbolt.org/z/eCsakP and copied below. I hope the XXXXXX comments make sense and important static assertions in the main() at the bottom explain what is the expected result. [...] To summary, I expect this to yield true:
std::is_same < mp11::mp_at_c<reference3_list, 0> bit_range_reference<std::uint8_t, 0, 3, true> const
I got this confirmed by all GCC versions but GCC 4.8. (clang and MSVC also seem to agree with the GCC >= 4.9)
Is mp11::mp_transform loosing const-qualification or have I made a mistake somewhere?
For the archive completeness, in case anyone is looking for answer to similar question: As Peter confirmed on the Slack, MP11 originally supported GCC 4.9+ and 4.8 support is partial, not without issues. My use case above was hit but one of such issues, in GCC 4.8, as commented here: https://github.com/boostorg/mp11/blob/e5d6e0d0b991a99c71a2b8f5057d0f0a1a89e0... #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. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Fingerprint=C081 EA1B 4AFB 7C19 38BA 9C88 928D 7C2A BB2A C1F2