You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example, the operand of typeid (an xvalue of a polymorphic class type) wasn't evaluated in C++98, but was made to evaluated since C++11 due to N3055.
#include<typeinfo>
#include<cstdio>structB {
virtual~B() { std::puts("~B"); }
};
structD : B {};
structWrapB {
B b;
};
structWrapD {
D d;
};
intmain() {
typeid(true ? WrapB().b : WrapD().d);
}