We all know that throwing pointers to exception is bad:
try
{
...
throw new MyExceptionClass();
}
catch (MyExceptionClass* e)
{
...
}
What's your approach to cleaning the catch targets up in legacy code? I figure that I can fix the first part by making operator new
private:
class MyExceptionClass
{
public:
...
private:
void* operator new(size_t);
}
How can I make the catch side of things equally ugly at compile-time? I don't want to just cause this to fall into the catch (...)
territory.