Topic: Exception specifications and function pointers.


Author: olaf@cwi.nl (Olaf Weber)
Date: Thu, 23 Feb 1995 10:09:25 GMT
Raw View
In the latest version of the ANSI/ISO Resultions chapter, Bjarne
Stroustrup writes

 (r.15.4) A pointer to function can have an _exception-
 specification_.  For example:

  void f() throw(int);            // ok
  void (*fp)() throw(int);        // ok
  void(void af() throw(int));     // ok

Not mentioned is what a function that returns a pointer to a function
looks like; no grammar rules are given.  I presume it should be

 void (*f() throw(float))() throw(int);

where `f' is a function that throws a float, and returns a function
pointer of type `void (*)() throw(int)'.  Is this correct?  If not,
how do you specify such a beast?

-- Olaf Weber