👌 added another conversion function #1315
This commit is contained in:
parent
20038e2703
commit
c2e175763c
2 changed files with 22 additions and 0 deletions
|
@ -965,6 +965,17 @@ class binary_writer
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < typename InputCharType, typename C = CharType,
|
||||||
|
enable_if_t <
|
||||||
|
std::is_signed<C>::value and
|
||||||
|
std::is_signed<char>::value and
|
||||||
|
std::is_same<char, typename std::remove_cv<InputCharType>::type>::value
|
||||||
|
> * = nullptr >
|
||||||
|
static constexpr CharType to_char_type(InputCharType x) noexcept
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// whether we can assume little endianess
|
/// whether we can assume little endianess
|
||||||
const bool is_little_endian = binary_reader<BasicJsonType>::little_endianess();
|
const bool is_little_endian = binary_reader<BasicJsonType>::little_endianess();
|
||||||
|
|
|
@ -9010,6 +9010,17 @@ class binary_writer
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < typename InputCharType, typename C = CharType,
|
||||||
|
enable_if_t <
|
||||||
|
std::is_signed<C>::value and
|
||||||
|
std::is_signed<char>::value and
|
||||||
|
std::is_same<char, typename std::remove_cv<InputCharType>::type>::value
|
||||||
|
> * = nullptr >
|
||||||
|
static constexpr CharType to_char_type(InputCharType x) noexcept
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// whether we can assume little endianess
|
/// whether we can assume little endianess
|
||||||
const bool is_little_endian = binary_reader<BasicJsonType>::little_endianess();
|
const bool is_little_endian = binary_reader<BasicJsonType>::little_endianess();
|
||||||
|
|
Loading…
Reference in a new issue