---------------
Christof Meerwald@freec++.prog

home
> prog
>> freecpp
>>> bad typeid

translate to German (by SYSTRAN)

typeid Throws std::bad_typeid

> bad_typeid.cpp:

#include <typeinfo>


struct A
{
 public:
  virtual ~A()
  { }
};


int main(int argc, char *argv[])
{
  A *a = 0;

  try
  {
    typeid(*a);
  }
  catch (const std::bad_typeid &e)
  {
    return 0;
  }

  return 1;
}
---------------

This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.

Revision: 1.2, cmeerw.org/prog/freecpp/bad_typeid.html
Last modified: Mon Sep 03 18:20:50 2018
Christof Meerwald <cmeerw@cmeerw.org>
XMPP: cmeerw@cmeerw.org