Topic: Exception specification for overriding functions


Author: kak@purdue.edu (Avi Kak)
Date: Sun, 3 Nov 2002 17:37:34 +0000 (UTC)
Raw View
Hello:


   Forgive me in advance if my question below is inappropriate
   or unreasonable in any way.

   Which clause of the standard (14882-1998) describes the
   restrictions on the exception specifications for an
   overriding function in a derived class vis-a-vis the
   exception specification for the overridden function in
   a base class?

   I have scanned through the material dealing with derived
   classes (clause 10) of the standard, but have not seen
   any mention of the restrictions I am looking for.

   If someone could point me in the right direction, I'd be
   grateful.  Thanks.

Avi Kak
kak@purdue.edu


P.S.:  I'd also like to thank Victor Bazarov and Ron Natalie
       for their replies to an earlier post by me.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: markus.mauhart@nospamm.chello.at ("Markus Mauhart")
Date: Sun, 3 Nov 2002 21:45:54 +0000 (UTC)
Raw View
"Avi Kak" <kak@purdue.edu> wrote ...
>
>    Which clause of the standard (14882-1998) describes the
>    restrictions on the exception specifications for an
>    overriding function in a derived class vis-a-vis the
>    exception specification for the overridden function in
>    a base class?

------------------------------
"[except.spec] 15.4 Exception specifications
3 If a virtual function has an exceptionspecification, all declarations,
including the definition, of any function that overrides that virtual
function in any derived class shall only allow exceptions that are
allowed by the exceptionspecification of the base class virtual function."
------------------------------


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: vAbazarov@dAnai.com ("Victor Bazarov")
Date: Sun, 3 Nov 2002 22:16:48 +0000 (UTC)
Raw View
"Avi Kak" <kak@purdue.edu> wrote...
>    Which clause of the standard (14882-1998) describes the
>    restrictions on the exception specifications for an
>    overriding function in a derived class vis-a-vis the
>    exception specification for the overridden function in
>    a base class?

15.4 (paragraph 3)

>    I have scanned through the material dealing with derived
>    classes (clause 10) of the standard, but have not seen
>    any mention of the restrictions I am looking for.

Chapter 15 is a separate chapter that deals with exceptions.

Victor
--
Please remove capital A's from my address when replying by mail


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: loewis@informatik.hu-berlin.de (Martin v. =?iso-8859-1?q?L=F6wis?=)
Date: Sun, 3 Nov 2002 22:16:51 +0000 (UTC)
Raw View
kak@purdue.edu (Avi Kak) writes:

>    Forgive me in advance if my question below is inappropriate
>    or unreasonable in any way.

Your question is completely on-topic in this group.

>    Which clause of the standard (14882-1998) describes the
>    restrictions on the exception specifications for an
>    overriding function in a derived class vis-a-vis the
>    exception specification for the overridden function in
>    a base class?

15.4/3.

>    I have scanned through the material dealing with derived
>    classes (clause 10) of the standard, but have not seen
>    any mention of the restrictions I am looking for.

Since this is about exceptions and inheritance, the two obvious places
to look for it are in the inheritance clause (10), as you did, and in
the exception clause (15). I believe the standard avoids backward
references whereever possible, so putting it into 15 seems natural.

HTH,
Martin

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]