|
|
От: | reversecode | |
| Дата: | 12.02.22 20:11 | ||
| Оценка: | |||
Variant: Fix so it works with C++20
C++20 changed some aspects of templates that broke variant.h on
some compilers (GCC 11).
Ref: https://wg21.cmeerw.net/cwg/issue2237
template<class T>
struct A {
A<T>(); // ok pre-C++20, now incorrect
// A(); // correct for all versions
};
This commit removes the "simple-template-id" from both the default
constructor (no args) and the explicit constructor (has args), even
though only the default constructor currently gives error on GCC 11.
Since both versions are wrong according to the issue referred to above
it is expected that GCC (and possibly other compilers) will be updated
to fail on both cases in the future.