On Thu 07 Jan 2016 at 18:53:53 +0100, Detlef Graef wrote:
> Maybe someone can tell me if the function "c_str()" from std::string can
> be simply replaced with "str" from StringView struct?
> 
> See line 72 here:
> 
> https://git.gnome.org/browse/pan2/tree/pan/general/string-view.h

I'd say so, yes. They both do (unsafe) access to the underlying
characters. If there is code where you replace std::strings with
StringViews (because of the rule not to put std::strings into
StringViews), then that would be an equivalent subsitution.

I agree with the remark earlier in the thread that lots of StringViews
ough to be replaced with std::string though, but that needs to be done
consistently so the previous rule isn't broken.

Maybe a first step to (temporarly, maybe) remove the constructor
StringView (const std::string& s) 
would be elucidating to find out how wide-spread the problem actually
is.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl    -- 'this bath is too hot.'

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Pan-users mailing list
Pan-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/pan-users

Reply via email to