This is the same as:
class roman; x3::rule<roman, unsigned> const roman = "roman";
In other words, writing class T where the type name is expected, first declares that T is the class name, and then goes to T as the type name used for the rest of the expression.
Note that in C ++ there is no collision between typename roman and the variable name roman declared here; It is allowed.
Another case of this can happen without patterns, for example:
void func( class bar *ptr );
is correct if bar not declared; it declares bar , and then declares a function to point to a pointer to bar .
MM Aug 31 '16 at 1:38 2016-08-31 01:38
source share