C++ Logo


Advanced search

Re: why does std::basic_string should accept an std::basic_string_view with the same charT and Traits

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 13 Sep 2020 13:36:22 -0700
On Sunday, 13 September 2020 12:21:47 PDT Nikolay Mihaylov wrote:
> I disagree, but will leave the exercise for you.
> Sure you can do strings like "hello\0world\0" but these are more abuse than
> something that is useful.

Irrelevant. The point is they are permitted. Therefore memcmp() is correct and
strcmp() is not.

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

Received on 2020-09-13 15:36:28