summaryrefslogtreecommitdiff
path: root/include/primitive_detail.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/primitive_detail.h')
-rw-r--r--include/primitive_detail.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/include/primitive_detail.h b/include/primitive_detail.h
index de070d3320..c55cd18398 100644
--- a/include/primitive_detail.h
+++ b/include/primitive_detail.h
@@ -32,21 +32,43 @@
namespace nbt
{
-namespace detail
-{
- ///Meta-struct that holds the tag_type value for a specific primitive type
- template<class T> struct get_primitive_type
- { static_assert(sizeof(T) != sizeof(T), "Invalid type paramter for tag_primitive, can only use types that NBT uses"); };
+ namespace detail
+ {
+ /// Meta-struct that holds the tag_type value for a specific primitive
+ /// type
+ template <class T> struct get_primitive_type {
+ static_assert(sizeof(T) != sizeof(T),
+ "Invalid type paramter for tag_primitive, can only "
+ "use types that NBT uses");
+ };
- 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> {};
- template<> struct get_primitive_type<int32_t> : public std::integral_constant<tag_type, tag_type::Int> {};
- template<> struct get_primitive_type<int64_t> : public std::integral_constant<tag_type, tag_type::Long> {};
- template<> struct get_primitive_type<float> : public std::integral_constant<tag_type, tag_type::Float> {};
- template<> struct get_primitive_type<double> : public std::integral_constant<tag_type, tag_type::Double> {};
-}
+ 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> {
+ };
+ template <>
+ struct get_primitive_type<int32_t>
+ : public std::integral_constant<tag_type, tag_type::Int> {
+ };
+ template <>
+ struct get_primitive_type<int64_t>
+ : public std::integral_constant<tag_type, tag_type::Long> {
+ };
+ template <>
+ struct get_primitive_type<float>
+ : public std::integral_constant<tag_type, tag_type::Float> {
+ };
+ template <>
+ struct get_primitive_type<double>
+ : public std::integral_constant<tag_type, tag_type::Double> {
+ };
+ } // namespace detail
-}
+} // namespace nbt
///@endcond
#endif // PRIMITIVE_DETAIL_H_INCLUDED