Compiler error when template argument is specified in the constructor

Viewed 32

My code:

template <class T>
class Test {
    Test<T>() = default;
};

gives the error:

error: expected unqualified-id before ‘)’ token 165 |
Test() = default;

C++ standard used is 20.g++ 11.2.

What is causing this?

0 Answers
Related