6 int Name(void) { return 1; }
9 class Derived : public Signal {
11 int Name(void) { return 2; }
14 template <class Foo , int (Foo::*Id)(void)>
18 int value (Foo* a) { return (a->*Id)(); }
21 /* The following line is illegal under the new rules for non-type
22 template arguments in the standard, so it is commented out. */
23 /* template class Bar <Derived, &Signal::Name>; */
24 template class Bar <Signal, &Signal::Name>;
25 template class Bar <Derived, &Derived::Name>;
29 /* Bar<Derived, &Signal::Name> dispatcher1; */
30 Bar<Derived, &Derived::Name> dispatcher2;
33 /* int i1 = dispatcher1.value(&a); */
34 int i2 = dispatcher2.value(&a);
35 return /* i1 != 1 || */ i2 != 2;