From 2cbc9fa3850a569a0844d92c8b4897646a2c53b3 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 17 Dec 2022 13:48:55 +0100 Subject: [PATCH] Add some nice TypeTraits --- luna/include/luna/TypeTraits.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 luna/include/luna/TypeTraits.h diff --git a/luna/include/luna/TypeTraits.h b/luna/include/luna/TypeTraits.h new file mode 100644 index 00000000..b9c6309c --- /dev/null +++ b/luna/include/luna/TypeTraits.h @@ -0,0 +1,4 @@ +#pragma once + +template inline constexpr bool IsBaseOf = __is_base_of(Base, Derived); +template inline constexpr bool IsPowerOfTwo = (value & (value - 1)) == 0; \ No newline at end of file