On 20/09/2019 20:52, Paavo Helde wrote:
> On 20.09.2019 19:05, Soviet_Mario wrote:
>> what's the meaning of that suffix 's' after the literal
>> char string ?
>> I've never seen that modifier :\
>
> I hoped that the line "using namespace
> std::literals::string_literals" would give a hint or at
> least provide something to google. But apparently not.
ah...okay, no did not even suspect such feature before
>
> Anyway, "abc"s is a std::string literal. You know, these are
> the kind of literals one should use in C++.
Good thing a native constant std::string !! I'll search
literals spread in code to replace with this new native type.
Uh another related question. When one uses a true string
literal "ABC"s to just intialize a variable string, instead
of a "ABC" char *, a more efficient code is generated ?
I mean, apart from the constness, these new literals are
identical types to std::string or
> The char*
> strings (and the problems with concatenating them) belong to
> another language which is supported for legacy only.
I understand this position, but thank God the back
compatibility is maintained. Quite some are still amidst the
transition and use C++ as just an improved C with classes
> If you
> just avoid using char* strings and literals your problem
> will disappear.
notice taken, I'll try to locate the more old style literals
I can to replace. And also the ugly .append () notation