C++ exception is just a hack. You can only catch an exception
explicitly thrown in your code. That is, C++ exception mechanism cannot catch exceptions raised
implicitly by your code.
An invariant, on the other hand, is a boolean statement as part of the definition of a class. Once the invocation of a method of class violates the invariant, the compiler implicitly raises the exception associated with the invariant. C++ exception cannot catch such an exception.
Z++ classes/tasks can specify any number of invariant statements, each with its own exception to be raised.
In addition, methods of a class can specify constraints, each with its own exception to be raised.
C++ is just a subset of Z++. Furthermore, Z++ is platform independent and component oriented.