From d8210d5a83faa345046648e520d82b54ea724e35 Mon Sep 17 00:00:00 2001 From: Henry Lee Date: Tue, 29 Jan 2019 12:31:58 +1100 Subject: [PATCH] Make changes on the make_unsigned type trait (#5136) Fix a typo in the static assert message in `make_unsigned` Support more specifications for `make_unsigned` --- include/flatbuffers/stl_emulation.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/flatbuffers/stl_emulation.h b/include/flatbuffers/stl_emulation.h index 028cc6fd2..6f6e76642 100644 --- a/include/flatbuffers/stl_emulation.h +++ b/include/flatbuffers/stl_emulation.h @@ -148,11 +148,15 @@ inline void vector_emplace_back(std::vector *vector, V &&data) { template using is_unsigned = std::tr1::is_unsigned; // Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned. template struct make_unsigned { - static_assert(is_unsigned::value, "Specialization not impelented!"); + static_assert(is_unsigned::value, "Specialization not implemented!"); using type = T; }; template<> struct make_unsigned { using type = unsigned char; }; - template<> struct make_unsigned { using type = unsigned int; }; + template<> struct make_unsigned { using type = unsigned short; }; + template<> struct make_unsigned { using type = unsigned int; }; + template<> struct make_unsigned { using type = unsigned long; }; + template<> + struct make_unsigned { using type = unsigned long long; }; #endif // !FLATBUFFERS_CPP98_STL #else // MSVC 2010 doesn't support C++11 aliases.