mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 14:20:02 +00:00
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`
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
7d3930a2fd
commit
d8210d5a83
@@ -148,11 +148,15 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
|
|||||||
template <typename T> using is_unsigned = std::tr1::is_unsigned<T>;
|
template <typename T> using is_unsigned = std::tr1::is_unsigned<T>;
|
||||||
// Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned.
|
// Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned.
|
||||||
template<typename T> struct make_unsigned {
|
template<typename T> struct make_unsigned {
|
||||||
static_assert(is_unsigned<T>::value, "Specialization not impelented!");
|
static_assert(is_unsigned<T>::value, "Specialization not implemented!");
|
||||||
using type = T;
|
using type = T;
|
||||||
};
|
};
|
||||||
template<> struct make_unsigned<char> { using type = unsigned char; };
|
template<> struct make_unsigned<char> { using type = unsigned char; };
|
||||||
template<> struct make_unsigned<int> { using type = unsigned int; };
|
template<> struct make_unsigned<short> { using type = unsigned short; };
|
||||||
|
template<> struct make_unsigned<int> { using type = unsigned int; };
|
||||||
|
template<> struct make_unsigned<long> { using type = unsigned long; };
|
||||||
|
template<>
|
||||||
|
struct make_unsigned<long long> { using type = unsigned long long; };
|
||||||
#endif // !FLATBUFFERS_CPP98_STL
|
#endif // !FLATBUFFERS_CPP98_STL
|
||||||
#else
|
#else
|
||||||
// MSVC 2010 doesn't support C++11 aliases.
|
// MSVC 2010 doesn't support C++11 aliases.
|
||||||
|
|||||||
Reference in New Issue
Block a user