summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-07-01 22:27:09 +0200
committerljfa-ag <ljfa-ag@web.de>2015-07-01 22:27:09 +0200
commit452a495e3c8cc09525dca777f0ead6f24b904a1c (patch)
tree8ed04d4ccdedcd7b3c2979b8177375dc3a74d7b1 /include
parent3dfa9f71eedd26eaaaba60573d2a6b7a2ab60b8c (diff)
downloadProject-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.h5
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> {};