Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
PTR_EXCEPTION_SPEC.cpp
Go to the documentation of this file.
1// checking for pointer exception specification
2
3
25struct S
26{
27 void foo () throw () { }
28 void bar () const throw (int) { }
29 void foobar () throw (int, double) { }
30};
31
32void foo () throw (char, long)
33{
34 // exception specification is not part of a function type (15.4, p12)
35 // but must be observed when assigning the adress of a function to
36 // a pointer to a function (15.4, p3)
37 void (*p_foo)() throw (char, long) = &foo;
38
39 void (S::*p_mfoo)() throw () = &S::foo;
40 void (S::*p_mbar)() const throw (int) = &S::bar;
41 void (S::*p_mfoobar)() throw (int, double) = &S::foobar;
42
43 // prevent "unused" warnings
44 (void)&p_foo;
45 (void)&p_mfoo;
46 (void)&p_mbar;
47 (void)&p_mfoobar;
48}
void foo()
void bar() const
void foo()
void foobar()