You are already not catch
ing access violations and you never could. Access violations are not C++ exceptions. They are "exceptions" of a different kind — that raised by your operating system. I prefer not to call them "exceptions" at all, in fact.
Linux and Linux-like operating systems simply terminate a process (using a signal) that performs an access violation.
Windows instead uses something called "structured exceptions" which you can potentially catch and possibly ignore using language extensions in Visual Studio. We're venturing off-topic now, but you could read up about those. I still wouldn't recommend their use, mind you. Once you have an access violation I'd personally be content to say "all bets are off", and "we have some debugging to do".
catch
statement does not catch all exceptions. Only those who derive fromstd::exception
. In C++, exceptions are not required to derive fromstd::exception
or even be instances of a class; you canthrow
anint
, for example.