Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::typeinfo

 

std::typeinfo is an STL class returned by typeid.

 

#include <cassert>
#include <string>
#include <typeinfo>

int main()
{
  assert(std::string(typeid(int).name())=="i");
  assert(std::string(typeid(double).name())=="d");
  assert(std::string(typeid(std::string).name())=="Ss");
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict