What's the lifetime of the object returned by typeid operator?
问题 If I call typeid and retrieve the address of returned type_info : const type_info* info = &( typeid( Something ) ); what's the lifetime of the object returned by typeid and how long will the pointer to that object remain valid? 回答1: However the implementation implements them, the results of typeid expressions are lvalues and the lifetime of the objects that those lvalues refer to must last until the end of the program. From ISO/IEC 14882:2003 5.2.8 [expr.typeid]: The result of a typeid