Silense clang deprecated warning in unicode converters
This commit is contained in:
parent
e37bdf6bd2
commit
bf90a8edd9
1 changed files with 9 additions and 0 deletions
|
|
@ -6,6 +6,11 @@
|
|||
namespace psemek::util
|
||||
{
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
using converter = std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t>;
|
||||
|
||||
std::string to_utf8(std::u32string const & str)
|
||||
|
|
@ -18,6 +23,10 @@ namespace psemek::util
|
|||
return converter{}.from_bytes(str);
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
static bool is_1_byte(char c)
|
||||
{
|
||||
return (c & 0b10000000) == 0b00000000;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue