Tomasz Kamiński [Wednesday, 18 February 2026 11:01:14 CET]:
> This implements LWG4383 with LWG4500, LWG4523 follow-up corrections.
> 
> This patch changes the constant_wrapper assignments operator (including
> compounds), increment and decrement to apply directly to value. In
> consequence the operators are only supported for types, for which above
> operations can be applied on const value.
> 
> libstdc++-v3/ChangeLog:
> 
>       * include/std/type_traits (_CWOperators::operator++)
>       (_CWOperators::operator--, _CWOperators::operator+=)
>       (_CWOperators::operator-=, _CWOperators::operator*=)
>       (_CWOperators::operator/=, _CWOperators::operator%=)
>       (_CWOperators::operator&=, _CWOperators::operator|=)
>       (_CWOperators::operator^=, _CWOperators::operator<<=)
>       (_CWOperators::operator>>=, constant_wrapper::operator=):
>       Adjust definitions to apply operator on value.
>       * testsuite/20_util/constant_wrapper/generic.cc:
>       Remove test_pseudo_mutator.
>       * testsuite/20_util/constant_wrapper/instantiate.cc:
>       Test that operators are not provided if wrapped type
>       do not support them, or provide mutable operators.
> ---
> Tested on x86_64-linux. OK for trunk?
> 
>  libstdc++-v3/include/std/type_traits          | 110 ++---
>  .../20_util/constant_wrapper/generic.cc       |  14 -
>  .../20_util/constant_wrapper/instantiate.cc   | 441 ++++++++++++------
>  3 files changed, 323 insertions(+), 242 deletions(-)
> 
> diff --git a/libstdc++-v3/include/std/type_traits
> b/libstdc++-v3/include/std/type_traits index ea700d1ed97..2fe3b48a938
> 100644
> --- a/libstdc++-v3/include/std/type_traits
> +++ b/libstdc++-v3/include/std/type_traits
> @@ -4593,9 +4593,8 @@ template<typename _Ret, typename _Fn, typename...
> _Args> template<_ConstExprParam _Tp, _ConstExprParam... _Args>
>        constexpr auto
>        operator()(this _Tp, _Args...) noexcept
> -      requires
> -     requires(_Args...) { constant_wrapper<_Tp::value(_Args::value...)>(); 
}
> -      { return constant_wrapper<_Tp::value(_Args::value...)>{}; }
> +        -> constant_wrapper<(_Tp::value(_Args::value...))>
> +      { return {}; }
> 
>      template<_ConstExprParam _Tp, _ConstExprParam... _Args>
>        constexpr auto
> @@ -4606,128 +4605,86 @@ template<typename _Ret, typename _Fn, typename...
> _Args> template<_ConstExprParam _Tp>

Why are you changing operator()? I see no Changelog entry for it. And as far 
as I understand, this change makes it IFNDR for arithmetic types.

- Matthias

-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Center for Heavy Ion Research               https://gsi.de
 std::simd
──────────────────────────────────────────────────────────────────────────

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to