You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example, the following invalid expression/type seem to be made in immediate context by CWG2672 (because only the lambda body is not in the immediate context), and thus should trigger SFINAE.
template <classT>
autoh(T) -> decltype([x = T::invalid]() { });
voidh(...);
h(0); // error: invalid expression not part of the immediate contexttemplate <classT>
autoi(T) -> decltype([]() -> typename T::invalid { });
voidi(...);
i(0); // error: invalid expression not part of the immediate context
Also, it's unclear to me why the lambda body is instantiated in the following case (although implementations agree):
template <classT, std::size_t = sizeof([]() { T::invalid; })>
voidg(T);
voidg(...);
g(0); // error: invalid expression not part of the immediate context
The lambda expression is not called, so it seems to me that return type deduction doesn't happen, and thus the lambda body shouldn't be instantiated.
The text was updated successfully, but these errors were encountered:
In the example, the following invalid expression/type seem to be made in immediate context by CWG2672 (because only the lambda body is not in the immediate context), and thus should trigger SFINAE.
Also, it's unclear to me why the lambda body is instantiated in the following case (although implementations agree):
The lambda expression is not called, so it seems to me that return type deduction doesn't happen, and thus the lambda body shouldn't be instantiated.
The text was updated successfully, but these errors were encountered: