summaryrefslogtreecommitdiff
path: root/c++/unit_cast.h
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-08-25 10:10:51 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-08-25 10:10:51 +0200
commit488653602d0636a1fa5ef6e64cabb9b903dce42a (patch)
treeb5d4bbffdf21017777f4c4d994b7b41a02e8fa5d /c++/unit_cast.h
parente3c73b2c8b33b43d53de6d2106b93a4343609e80 (diff)
Renamed src folder to c++
Diffstat (limited to 'c++/unit_cast.h')
-rw-r--r--c++/unit_cast.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/c++/unit_cast.h b/c++/unit_cast.h
new file mode 100644
index 0000000..8dc2689
--- /dev/null
+++ b/c++/unit_cast.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <forstio/core/common.h>
+
+namespace kel {
+template<typename S, typename From, typename To>
+class unit_convert {
+ static_assert(always_false<S, From, To>, "Units can't be converted to each other");
+};
+
+template<typename Store, typename Same>
+class unit_convert<Store, Same, Same> {
+ static constexpr factor = static_cast<Store>(1);
+};
+}