vector<bool> _M_start and 0 offset

François Dumont frs.dumont@gmail.com
Mon Sep 17 20:44:00 GMT 2018


Note that if
https://gcc.gnu.org/ml/libstdc++/2018-09/msg00052.html

was accepted we could perhaps achieve the same result by adding:

__glibcxx_assert(_M_start._M_offset == 0);


On 09/17/2018 09:50 PM, Marc Glisse wrote:
> On Mon, 17 Sep 2018, Jonathan Wakely wrote:
>
>> On 17/09/18 21:24 +0200, Marc Glisse wrote:
>>> On Mon, 17 Sep 2018, Marc Glisse wrote:
>>>
>>>> On Mon, 17 Sep 2018, Jonathan Wakely wrote:
>>>>
>>>>>> Do other compilers besides gcc suppress the same way?
>>>>>
>>>>> No, clang doesn't:
>>>>
>>>> What version is that? I didn't test on this exact patch, but clang 
>>>> 6 and
>>>> 7 print, for similar code:
>>>>
>>>> warning: generalized initializer lists are a C++11 extension
>>>>     [-Wc++11-extensions]
>>>
>>> Ah, with the exact code I do get an error indeed. I'll change the 
>>> code :-(
>>
>> Thanks. I feel your pain, but I think we'd need a better reason to
>> break it (the valid C++98 code is uglier but not too painful).
>>
>> The cbegin() change can still use C++11 syntax.
>
> I think I'd rather keep the 3 lines identical, or make cbegin() call
> begin().
>



More information about the Libstdc++ mailing list