C++ Logo

std-proposals

Advanced search

[std-proposals] Stop adding more member functions that shouldn't be added

From: blacktea hamburger <greenteahamburger_at_[hidden]>
Date: Sun, 16 Oct 2022 16:33:10 +0800
http://www.gotw.ca/gotw/084.htm expounds that where possible, prefer
writing functions as nonmember nonfriends. So many mistakes have been made
in the standard library, but they are hard to correct. So now we can only
stop making more mistakes like std::basic_string::contains, which I
recommend removing.

I thought maybe the named requirements could also be changed to avoid
containers added later having to add some member functions that shouldn't
be added.

Received on 2022-10-16 08:33:42