From 452a495e3c8cc09525dca777f0ead6f24b904a1c Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 1 Jul 2015 22:27:09 +0200 Subject: Give meaningful fail message for wrong primitive --- include/primitive_detail.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') 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 struct get_primitive_type; + template 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 : public std::integral_constant {}; template<> struct get_primitive_type : public std::integral_constant {}; -- cgit 0.0.5-2-1-g0f52