Closed quark17 closed 1 month ago
Earlier C++ standards allowed the constructor and destructor of a templated class to be declared with a templated identifier. For example:
template<typename T> class Foo { public: Foo<T>(); ~Foo<T>(); };
This is not accepted by the newer C++ standard, and GCC warns about that:
warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
This PR resolves it by removing the unnecessary parameters in the constructor and destructor identifiers:
template<typename T> class Foo { public: Foo(); ~Foo(); };
Earlier C++ standards allowed the constructor and destructor of a templated class to be declared with a templated identifier. For example:
This is not accepted by the newer C++ standard, and GCC warns about that:
This PR resolves it by removing the unnecessary parameters in the constructor and destructor identifiers: