-
Notifications
You must be signed in to change notification settings - Fork 790
Open
Description
Currently, it is defined as:
template<constexpr-param T, constexpr-param... Args> constexpr auto operator()(this T, Args...) noexcept requires requires(Args...) { constant_wrapper<T::value(Args::value...)>(); } { return constant_wrapper<T::value(Args::value...)>{}; }
The requires clause here is
requires requires(Args...) { constant_wrapper<T::value(Args::value...)>(); }
First, the Args...
here seems redundant, since we can already access the Args...
in the template parameter list.
Second, the ()
here actually means the construction of constant_wrapper
, it seems that using {}
is more appropriate and consistent with the return statement and the function body.
So in my opinion, this should be better with (most likely editorial):
template<constexpr-param T, constexpr-param... Args> constexpr auto operator()(this T, Args...) noexcept requires requires { constant_wrapper<T::value(Args::value...)>{}; } { return constant_wrapper<T::value(Args::value...)>{}; }
Or even better with typename
(probably not editorial):
template<constexpr-param T, constexpr-param... Args> constexpr auto operator()(this T, Args...) noexcept requires requires { typename constant_wrapper<T::value(Args::value...)>; } { return constant_wrapper<T::value(Args::value...)>{}; }
Please let me know if I'm missing anything.
Metadata
Metadata
Assignees
Labels
No labels