Should a substituted constraint expression that is not a constant expression result in a hard-error?
The expression T::b
where T = a
can’t be resolved because
b
is a non-static member of a
. Should the formation of
such an invalid expression lead to
the requires-expression of c
to be evaluated to false
?
Or, should this result in a hard-error instead? And, if so, why?
Should a substituted constraint expression that is not a constant expression result in a hard-error?
The expression T::b
where T = a
can’t be resolved because
b
is a non-static member of a
. Should the formation of
such an invalid expression lead to
the requires-expression of c
to be evaluated to false
?
Or, should this result in a hard-error instead? And, if so, why?
Should a substituted constraint expression that is not a constant expression result in a hard-error?
The expression T::b
where T = a
can’t be resolved because
b
is a non-static member of a
. Should the formation of
such an invalid expression lead to
the requires-expression of c
to be evaluated to false
?
Or, should this result in a hard-error instead? And, if so, why?
how c++ compiler matches “Class::operator==”?
I found the following code cann’t be compiled before c++20:
Is it mandatory to infer the type of the default template argument on each instantiation?
Having this code, GCC and MSVC are both happy with it, when clang complains. Any two lambdas must have different types, which makes me think that clang “caches” the type of the default template argument (but only if the class itself is a template).
Is it valid to call std::destroy_at on a unconstructed object?
When I was reading the sample code of std::construct_at
at cppref, I noticed that std::destroy_at
is called on a uninitialized buffer:
Does operator < need to be declared before calling std::lexicographical_compare
The following code compiles before c++20:
On which member is no_unique_address needed and why?
Consider the following two struct
s whose sizes are 8 and 1 bytes respectively:
get constexpr variable from a lambda function is fine , but compile fail (Visual C++) and fine (gcc) when such statement is in a new lambda
This code compiles fine in gcc, but fail in Visual C++.
When did closure types finally became structural types?
There once was a long disscusion going on whether closure types should be considered as structural types or not (essentially determining whether they would be eligible as NTTPs). An interesting post about this, made by user dfrib, can be found here.