aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-04-15 19:37:06 +0200
committerSven Göthel <[email protected]>2024-04-15 19:37:06 +0200
commitf2bb054ae5cb8fd0018447599897b9fdffcdd707 (patch)
tree447d40d4bb4203b4505dd6007691e0ab7166dce9
parentd1208567bc21f459dbbdb6d311d90cddc52cb704 (diff)
int_types: Add template-arg type float_bytes<>, allowing to meta-prog matching float type based on size
-rw-r--r--include/jau/int_types.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/jau/int_types.hpp b/include/jau/int_types.hpp
index 03f49ef..f3c245d 100644
--- a/include/jau/int_types.hpp
+++ b/include/jau/int_types.hpp
@@ -80,6 +80,11 @@ namespace jau {
template <> struct sint_bytes<16>{ using type = int128_t; };
#endif
+ template <int bytesize> struct float_bytes;
+ template <> struct float_bytes<sizeof(float)>{ using type = float; };
+ template <> struct float_bytes<sizeof(double)>{ using type = double; };
+ template <> struct float_bytes<sizeof(long double)>{ using type = long double; };
+
/**
// *************************************************
// *************************************************