diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-01 22:27:09 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-01 22:27:09 +0200 |
| commit | 452a495e3c8cc09525dca777f0ead6f24b904a1c (patch) | |
| tree | 8ed04d4ccdedcd7b3c2979b8177375dc3a74d7b1 /include | |
| parent | 3dfa9f71eedd26eaaaba60573d2a6b7a2ab60b8c (diff) | |
| download | Project-Tick-452a495e3c8cc09525dca777f0ead6f24b904a1c.tar.gz Project-Tick-452a495e3c8cc09525dca777f0ead6f24b904a1c.zip | |
Give meaningful fail message for wrong primitive
Diffstat (limited to 'include')
| -rw-r--r-- | include/primitive_detail.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/primitive_detail.h b/include/primitive_detail.h index c7e2a05206..dea7ff225f 100644 --- a/include/primitive_detail.h +++ b/include/primitive_detail.h @@ -29,7 +29,10 @@ namespace nbt namespace detail { ///Meta-struct that holds the tag_type value for a specific primitive type - template<class T> struct get_primitive_type; + template<class T> struct get_primitive_type + { + static_assert(sizeof(T) != sizeof(T), "Can only use primitive types used by NBT as parameter for tag_primitive"); + }; template<> struct get_primitive_type<int8_t> : public std::integral_constant<tag_type, tag_type::Byte> {}; template<> struct get_primitive_type<int16_t> : public std::integral_constant<tag_type, tag_type::Short> {}; |
