Up till C++2011 there was no guarantee of a terminating null-pointer in std::string s.
So std::string("") is not empty empty, but it has size 0 ... and is empty()
Really weird :-)
-----Ursprüngliche Nachricht-----
Von: Ville Voutilainen via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 19.10.2023 18:54
Betreff: Re: [std-proposals] Bool casting operator to check if a container not empty
An: std-proposals@lists.isocpp.org;
CC: Ville Voutilainen <ville.voutilainen@gmail.com>; Giuseppe D‘Angelo <giuseppe.dangelo@kdab.com>;
On Thu, 19 Oct 2023 at 19:46, Giuseppe D'Angelo via Std-Proposals
The major reason why this thing was frowned upon in 2009 when I filed
an NB comment suggesting
such a change is that
if ("")
is true. I think it's wrong to reject the idea because of that,
because that's just a weird case