diff --git a/source/blender/blenkernel/BKE_image_wrappers.hh b/source/blender/blenkernel/BKE_image_wrappers.hh index edf03f4fe94..877db96d786 100644 --- a/source/blender/blenkernel/BKE_image_wrappers.hh +++ b/source/blender/blenkernel/BKE_image_wrappers.hh @@ -13,6 +13,7 @@ #include "BLI_math_color.h" #include "BLI_math_vector.h" #include "BLI_math_vector_types.hh" +#include "BLI_memory_utils.hh" #include "IMB_imbuf_types.hh" @@ -49,7 +50,7 @@ struct ImageTileWrapper { }; template struct ImageBufferAccessor { - static_assert(std::is_same_v || std::is_same_v); + static_assert(is_same_any_v); ImBuf &image_buffer; diff --git a/source/blender/blenkernel/intern/idprop_create.cc b/source/blender/blenkernel/intern/idprop_create.cc index c6d29cb1f0c..47f06613e0b 100644 --- a/source/blender/blenkernel/intern/idprop_create.cc +++ b/source/blender/blenkernel/intern/idprop_create.cc @@ -109,8 +109,7 @@ std::unique_ptr create_array(StringRef prop_name, Span values, const eIDPropertyFlag flags) { - static_assert(std::is_same_v || std::is_same_v || - std::is_same_v, + static_assert(is_same_any_v, "Allowed values for PrimitiveType are int32_t, float and double."); static_assert(!std::is_same_v || id_property_subtype == IDP_INT, "PrimitiveType and id_property_type do not match (int32_t)."); diff --git a/source/blender/compositor/COM_result.hh b/source/blender/compositor/COM_result.hh index fe581d0a05d..51ed794bdfc 100644 --- a/source/blender/compositor/COM_result.hh +++ b/source/blender/compositor/COM_result.hh @@ -987,8 +987,7 @@ template constexpr int Result::get_type_channels_count() template constexpr bool Result::is_supported_type() { - return std::is_same_v || std::is_same_v || std::is_same_v || - std::is_same_v || std::is_same_v; + return is_same_any_v; } template inline int64_t Result::get_pixel_index(const int2 &texel) const diff --git a/source/blender/geometry/intern/simplify_curves.cc b/source/blender/geometry/intern/simplify_curves.cc index 866c4312388..99f23d203d7 100644 --- a/source/blender/geometry/intern/simplify_curves.cc +++ b/source/blender/geometry/intern/simplify_curves.cc @@ -126,9 +126,7 @@ void curve_simplify(const Span positions, { bke::attribute_math::convert_to_static_type(attribute_data.type(), [&](auto dummy) { using T = decltype(dummy); - if constexpr (std::is_same_v || std::is_same_v || - std::is_same_v) - { + if constexpr (is_same_any_v) { curve_simplify(positions, cyclic, epsilon, attribute_data.typed(), points_to_delete); } }); @@ -152,9 +150,7 @@ IndexMask simplify_curve_attribute(const Span positions, const IndexRange points = points_by_curve[curve_i]; bke::attribute_math::convert_to_static_type(attribute_data.type(), [&](auto dummy) { using T = decltype(dummy); - if constexpr (std::is_same_v || std::is_same_v || - std::is_same_v) - { + if constexpr (is_same_any_v) { curve_simplify(positions.slice(points), cyclic[curve_i], epsilon, diff --git a/source/blender/geometry/intern/smooth_curves.cc b/source/blender/geometry/intern/smooth_curves.cc index 8521a4e1079..34f6d34e4f4 100644 --- a/source/blender/geometry/intern/smooth_curves.cc +++ b/source/blender/geometry/intern/smooth_curves.cc @@ -159,9 +159,7 @@ void gaussian_blur_1D(const GSpan src, using T = decltype(dummy); /* Only allow smoothing of float, float2, or float3. */ /* Reduces unnecessary code generation. */ - if constexpr (std::is_same_v || std::is_same_v || - std::is_same_v) - { + if constexpr (is_same_any_v) { gaussian_blur_1D(src.typed(), iterations, influence_by_point,