Exceptions and overridden methods
From: Milan Gornik (nospam_at_nospam.com)
Date: 03/30/05
- Next message: Milan Gornik: "Re: Allocating and returning new class in function"
- Previous message: Victor Bazarov: "Re: Allowing a functor or a function to be stored in a class"
- Next in thread: lilburne: "Re: Exceptions and overridden methods"
- Reply: lilburne: "Re: Exceptions and overridden methods"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Mar 2005 00:17:04 +0200
Hello guys,
I consulted both MSDN and Borland Builder's documentation to try to find
something about this, but I haven't found it. I saw that both VC++ and
Builder support different kinds of exception handling mechanisms. As I
understand, the standard way is to use exception handling through exception
classes and try/catch statements. Now, in Java, it is mandatory to supply
method prototype with info on which exceptions can occur. This seems to be
supported by Borland C++, and looks like a good way to have good, documented
code. Is it the part of ANSI C++ standard? Furthermore, I was in doubt what
to do if I have inherited class and want to override the parent's class
method. If I have method in base class which declares to throw some
exceptions, compiler would complain if exact set of exceptions were not
supplied by overriding method in derived class. I have situation in which I
would like to add some more possible exceptions in overridden method. Is it
possible, and should I really use this method of documenting possible
exceptions in methods?
Thanks in advance,
Milan Gornik
- Next message: Milan Gornik: "Re: Allocating and returning new class in function"
- Previous message: Victor Bazarov: "Re: Allowing a functor or a function to be stored in a class"
- Next in thread: lilburne: "Re: Exceptions and overridden methods"
- Reply: lilburne: "Re: Exceptions and overridden methods"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|