Why / how is C allowed to declare variables and functions of type C instead of having to specify C?
It is just so defined. The name of the template is entered into its body and means the actual type (with arguments).
Are there any quirks I should know about?
Nothing serious. You just need to remember that this does not work for base classes, so to do CRTP you need to do
template <class T> class A : public Base<A<T> > // not Base<A>
source share