Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_math_vec_types.hh')
-rw-r--r--source/blender/blenlib/BLI_math_vec_types.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vec_types.hh b/source/blender/blenlib/BLI_math_vec_types.hh
index 140367b6241..81e59b157ee 100644
--- a/source/blender/blenlib/BLI_math_vec_types.hh
+++ b/source/blender/blenlib/BLI_math_vec_types.hh
@@ -579,4 +579,15 @@ using double2 = vec_base<double, 2>;
using double3 = vec_base<double, 3>;
using double4 = vec_base<double, 4>;
+template<typename T> constexpr bool is_math_vec_type = false;
+template<typename BaseType, int Size>
+constexpr bool is_math_vec_type<vec_base<BaseType, Size>> = true;
+
+static_assert(is_math_vec_type<int2>);
+static_assert(is_math_vec_type<uint4>);
+static_assert(is_math_vec_type<float2>);
+static_assert(is_math_vec_type<vec_base<float, 20>>);
+static_assert(!is_math_vec_type<int>);
+static_assert(!is_math_vec_type<float>);
+
} // namespace blender