summaryrefslogtreecommitdiff
path: root/c++/unit_cast.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/unit_cast.hpp')
-rw-r--r--c++/unit_cast.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/c++/unit_cast.hpp b/c++/unit_cast.hpp
new file mode 100644
index 0000000..8dc2689
--- /dev/null
+++ b/c++/unit_cast.hpp
@@ -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);
+};
+}