Topic: functions returning function pointers


Author: Nathan Sidwell <nathan@cs.bris.ac.uk>
Date: 1998/04/28
Raw View
How to I declare a function which throws exceptions E1 and returns a
pointer to a function which throws exceptions E2?

typedef void (*fptr)();
fptr f1() throw(E1) throw(E2);

is this the right way round? ie does the throw(E1) associate with f1 and
throw(E2) associate with fptr? I'm asking because of the compiler I
have, SunCC4.1 doesn't understand exceptions and G++ 2.8.1 (and egcs)
doesn't understand exception specifications on function pointers.


nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]