diff --git a/include/boost/endian/conversion.hpp b/include/boost/endian/conversion.hpp index 9da4225..a316a3d 100644 --- a/include/boost/endian/conversion.hpp +++ b/include/boost/endian/conversion.hpp @@ -282,6 +282,20 @@ namespace endian # endif } + // overloads for char and char16_t, which otherwise use int32_t + + inline char endian_reverse(char x) BOOST_NOEXCEPT + { + return static_cast( endian_reverse( static_cast(x) ) ); + } + +#if !defined(BOOST_NO_CXX11_CHAR16_T) + inline char16_t endian_reverse(char16_t x) BOOST_NOEXCEPT + { + return static_cast( endian_reverse( static_cast(x) ) ); + } +#endif + template inline EndianReversible big_to_native(EndianReversible x) BOOST_NOEXCEPT {