diff --git a/libs/geom/include/psemek/geom/swizzle.hpp b/libs/geom/include/psemek/geom/swizzle.hpp index a6172c1d..20ec6057 100644 --- a/libs/geom/include/psemek/geom/swizzle.hpp +++ b/libs/geom/include/psemek/geom/swizzle.hpp @@ -21,12 +21,17 @@ namespace psemek::geom } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" + template constexpr auto swizzle = [](auto const & x){ + static_assert(((I == -1 || I < std::decay_t::static_dimension) && ...)); using result = typename detail::swizzle_rebind>::template type; using element = std::decay_t; return result{(I == (-1) ? element{} : x[I])...}; }; +#pragma GCC diagnostic pop }