On Thu, Feb 08, 2018 at 08:16:37AM +0100, Christophe de Dinechin wrote:
> Using std::string by default is *not* considered a good practice in
> C++. The reference for C++ good practices are probably best summarized
> by the C++ Core Guidelines:
> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md.
> Regarding strings, see
> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rstr-zstring,
> which specifically states this:
> 
>       Don't convert a C-style string to string unless there is a reason to.
> 
> “abc” is a C-style string, even in C++. You should pass it around as const 
> char *, aka czstring as long as you can. *That* is the C++ good practice 
> AFAIK.
> 

For maximal clarity, the link that you gave says *not* to use const char
*, but to use czstring instead... This does not say to "pass it around
as const char *".

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to