This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Disable some concept checks in C++11


On 05/03/2017 22:58, Jonathan Wakely wrote:
On 5 March 2017 at 16:03, François Dumont wrote:
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.

Indeed, I had in mind more elementary operations that could justify this concept check at class scope while in fact not complying to it only impacts a limited number of operations on the container. I start getting the point why current concept checks are not really used.

So slist also require it for its assign implementation. And a slist of not assignable type instances is used in libstdc++-prettyprinters/59161.cc. Should I just forget about it ? Go ahead with the patch except the slist part and then disable concept checks ?

François



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]