mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Do not use no longer supported std::char_traits
/usr/bin/../include/c++/v1/string_view:300:42: error: implicit instantiation of undefined template 'std::char_traits<signed char>' 300 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ /home/elsid/dev/openmw/components/to_utf8/to_utf8.cpp:55:41: note: in instantiation of template class 'std::basic_string_view<signed char>' requested here 55 | std::basic_string_view<signed char> getTranslationArray(FromType sourceEncoding) | ^ /usr/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ std::char_traits support for non char types was removed from libc++19: https://reviews.llvm.org/D157058.
This commit is contained in:
parent
569ed4559f
commit
e5ad1cd214
2 changed files with 3 additions and 2 deletions
|
@ -52,7 +52,7 @@ namespace
|
|||
return std::find_if(input.begin(), input.end(), [](unsigned char v) { return v == 0 || v >= 128; });
|
||||
}
|
||||
|
||||
std::basic_string_view<signed char> getTranslationArray(FromType sourceEncoding)
|
||||
std::span<const signed char> getTranslationArray(FromType sourceEncoding)
|
||||
{
|
||||
switch (sourceEncoding)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define COMPONENTS_TOUTF8_H
|
||||
|
||||
#include <cstring>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
@ -50,7 +51,7 @@ namespace ToUTF8
|
|||
inline void copyFromArrayLegacyEnc(
|
||||
std::string_view::iterator& chp, std::string_view::iterator end, char*& out) const;
|
||||
|
||||
const std::basic_string_view<signed char> mTranslationArray;
|
||||
const std::span<const signed char> mTranslationArray;
|
||||
};
|
||||
|
||||
class Utf8Encoder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue