I've read about a new class coming out in the C++ Standard Library this year called std::basic_string_view, which with char[] is std::string_view, with wchar_t[] is std::wstring_view, with char16_t[] is std::u16string_view, and with char32_t[] is std::u32string_view. It's great for having to pass strings to functions which need only to read them without taking ownership of them. It works especially well for parsers, in that you can keep narrowing the range of the string_view and make recursive function calls without having to make copies of the string, get the successive functions take ownership of the string, or work with pointer arithmetic that goes to dealing with double pointers, which is easy to shoot yourself in the foot with.
I could see something like a wxStringView, though I'm not sure how wxString stores its character data internally. Also, I think we could make wxString (and also wxStringView) able to copy from string_view.
Does this seem feasible?
wxString support for string_view?
Re: wxString support for string_view?
The mailing list / Google group is probably a better place to discuss this:
https://groups.google.com/forum/?hl=en& ... m/wx-users
https://groups.google.com/forum/?hl=en& ... m/wx-users
Use the source, Luke!
Re: wxString support for string_view?
I can't find any discussion about string_view in the maillist.
Indeed, I have the same question, so maybe I need to ask on in the maillist?
Indeed, I have the same question, so maybe I need to ask on in the maillist?
Re: wxString support for string_view?
Yes, please.I have the same question, so maybe I need to ask on in the maillist?
Use the source, Luke!