Series RTTI
Posted: Tue May 27, 2008 2:49 pm
I had the aim of storing a number of series in a vector of TChartSeries*, and then when reading them out of the vector, checking their type with typeid(). I ran into the following problem, however, and was wondering if you knew of a reason, and or fix:
Obviously this is meaning that I can't do
Code: Select all
TChartSeries* p = new TLineSeries(0);
std::string str1 = typeid(*p).name();
std::string str2 = typeid(TLineSeries).name();
// str1 = "TLineSeries"
// str2 = "Series::TLineSeries"
Code: Select all
if (typeid(*p) == typeid(TLineSeries) { ... }