I am experimenting with C++17 class template default argument and was wondering if anyone could explain:
If I have the following:
template<typename Policy = DefaultPolicy>
class MyClass { //class goes here };
And then try to use it as:
MyClass * class = new MyClass();
I get the error:
However both the following compile OK:
MyClass stackClass = MyClass();
auto * heapClass = new MyClass();
In particular I am very interested in how auto is working above. Thanks so much!
Perhaps there is also a concept name that describes this that I can google for more info also.
Working example: https://godbolt.org/z/EbEnxjcej