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 11:35:59 -0700
On Sunday, 13 September 2020 11:08:17 PDT Nikolay Mihaylov wrote:
> however, the compiler knows what strcmp is , so if you do
> strcmp(a.c_str(), b.c_str()) == 0;

No, you can't. That's not the same as the *correct* memcmp.

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

Received on 2020-09-13 13:36:04