diff options
author | Sven Göthel <[email protected]> | 2024-04-15 19:37:06 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-04-15 19:37:06 +0200 |
commit | f2bb054ae5cb8fd0018447599897b9fdffcdd707 (patch) | |
tree | 447d40d4bb4203b4505dd6007691e0ab7166dce9 | |
parent | d1208567bc21f459dbbdb6d311d90cddc52cb704 (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.hpp | 5 |
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; }; + /** // ************************************************* // ************************************************* |