From 925bed91c76ee9ec57a2c09080c4bc734ac73319 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 29 Aug 2024 11:15:54 +0200 Subject: [PATCH] Fix: mutable parameter should not be const This worked fine when passing in a `MutableBitSpan` to `invert`, but not when passing in a `BitVector`. --- source/blender/blenlib/BLI_bit_span_ops.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/blenlib/BLI_bit_span_ops.hh b/source/blender/blenlib/BLI_bit_span_ops.hh index e2bba819767..9ed5deeec2f 100644 --- a/source/blender/blenlib/BLI_bit_span_ops.hh +++ b/source/blender/blenlib/BLI_bit_span_ops.hh @@ -168,9 +168,7 @@ inline void foreach_1_index_expr(ExprFn &&expr, } // namespace detail template -inline void mix_into_first_expr(ExprFn &&expr, - const FirstBitSpanT &first_arg, - const BitSpanT &...args) +inline void mix_into_first_expr(ExprFn &&expr, FirstBitSpanT &&first_arg, const BitSpanT &...args) { detail::mix_into_first_expr(expr, to_best_bit_span(first_arg), to_best_bit_span(args)...); } @@ -191,7 +189,7 @@ inline void foreach_1_index_expr(ExprFn &&expr, expr, handle, to_best_bit_span(first_arg), to_best_bit_span(args)...); } -template inline void invert(const BitSpanT &data) +template inline void invert(BitSpanT &&data) { mix_into_first_expr([](const BitInt x) { return ~x; }, data); }