From bb1c40e06794e82a4f9aafaeddadd4c634f0a1b3 Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Tue, 23 May 2023 18:03:06 +0200 Subject: c++: casting between unit ideas --- src/kelunit/unit_cast.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/kelunit/unit_cast.h (limited to 'src') diff --git a/src/kelunit/unit_cast.h b/src/kelunit/unit_cast.h new file mode 100644 index 0000000..8dc2689 --- /dev/null +++ b/src/kelunit/unit_cast.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace kel { +template +class unit_convert { + static_assert(always_false, "Units can't be converted to each other"); +}; + +template +class unit_convert { + static constexpr factor = static_cast(1); +}; +} -- cgit v1.2.3