Disable some concept checks in C++11

Jonathan Wakely jwakely.gcc@gmail.com
Sun Mar 5 21:58:00 GMT 2017


On 5 March 2017 at 16:03, François Dumont wrote:
> On 02/03/2017 06:52, Jonathan Wakely wrote:
>>
>> On 27 February 2017 at 20:11, François Dumont wrote:
>>>
>>> Hi
>>>
>>>
>>>      I had some problems when testing pretty printers while having
>>> activated
>>> concept checks. I noticed that std::deque had already the
>>> _SGIAssignableConcept check disable when using C++11 so I propose to
>>> generalize to all usages of this concept check.
>>
>> The use in <ext/slist> seems to still be valid, that type wasn't
>> updated for C++11 and move semantics, so the original concept checks
>> still apply, don't they?
>
>
> I start wondering if this concept check is not too strict. And also why
> C++11 move semantic would make this concept check useless.
>
> It checks for both valid copy constructor and assignment operator. As far as
> I know containers never use copy assignment operator and never did. So why
> checking for its availability ?

Of course they use it, as a quick search in the standard shows.

Consider:

std::vector<X> v(1), v2(1);
v1 = v2;

Before C++11 elements were also assigned when inserting or erasing in
a vector (anywhere except the end), or when using std::sort, or using
std::remove_if etc. etc.
Now they will be move-assigned if possible, but some operations still
require CopyAssignable.



More information about the Libstdc++ mailing list