antlr4-cpp
antlr4-cpp copied to clipboard
About antlrcpp::Any derived.
Hi, There are the following codes:
class A {};
class B : public A {};
B *b = new B;
antlrcpp::Any any = b;
bool is = any.is<A*>();
Variable ìs' always `false'. How do I solve this type of derivation problem?
Maybe your can using another solution:
class A {};
class B : public A {};
A *b = (A*)new B;
antlrcpp::Any any = b;
bool is = any.is<A*>();//true