You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C++20 there is a std::u8string and char8_t to make UTF-8 type-safe.
Unfortunately when calling xml_attribute::set_value(u8"a string") for example compiler chooses set_value(bool) overload which lead to a surprise when all attrubutes became juse "true".
Which makes me thing that providing an overload which accepts bool is too wide: it can be any pointer at least. Would be nice to constrain it somehow.
I'm not sure if there is a need to have a separate handling when pugi::char_t is wchar_t or simply provide such overload when it's a char.
The text was updated successfully, but these errors were encountered:
I also thought that it may be a good idea to just use char8_t for pugixml::char_t since UTF-8 is used internally anyways.
I think if consumer could define PUGIXML_TEXT and PUGIXML_CHAR directly instead of relying on PUGIXML_WCHAR_MODE things will just work (or provide more knobs...)
Which makes me thing that providing an overload which accepts bool is too wide: it can be any pointer at least. Would be nice to constrain it somehow.
This is sensible; this can probably be achieved using a private overload with const void* argument, as you can't use enable_if or other constructs like this due to compatibility requirements. Separately, char8_t as char_t won't work because of reliance on some CRT functions like strcmp.
In C++20 there is a
std::u8string
andchar8_t
to make UTF-8 type-safe.Unfortunately when calling
xml_attribute::set_value(u8"a string")
for example compiler choosesset_value(bool)
overload which lead to a surprise when all attrubutes became juse"true"
.Which makes me thing that providing an overload which accepts
bool
is too wide: it can be any pointer at least. Would be nice to constrain it somehow.I'm not sure if there is a need to have a separate handling when
pugi::char_t
iswchar_t
or simply provide such overload when it's achar
.The text was updated successfully, but these errors were encountered: