summaryrefslogtreecommitdiff
path: root/c++/core
diff options
context:
space:
mode:
Diffstat (limited to 'c++/core')
-rw-r--r--c++/core/templates.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/c++/core/templates.h b/c++/core/templates.h
index 39befc1..a3a5f7a 100644
--- a/c++/core/templates.h
+++ b/c++/core/templates.h
@@ -73,4 +73,17 @@ struct parameter_key_pack_type {
static_assert(i < sizeof...(Keys), "Provided index is too large in list");
};
+template<typename T, T... V>
+struct ct_multiply;
+
+template<typename T>
+struct ct_multiply<T> {
+ static constexpr T value = 1;
+};
+
+template<typename T, T V0, T... VN>
+struct ct_multiply<T, V0, VN...> {
+ static constexpr T value = V0 * templ_multiply<T,VN...>::value;
+};
+
}