C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 16 Oct 2022 21:57:22 -0700
On Sunday, 16 October 2022 01:33:10 PDT blacktea hamburger via Std-Proposals
wrote:
> 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.

No function that was ever added was thought to have been incorrectly added at
the time that it was added. You're applying hindsight to determine that it was
incorrect.

Please provide guidelines to determine what should and what shouldn't be added
at the time of their proposal, before there's large-scale use or abuse.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2022-10-17 04:57:35