5 int Name(void) { return 1; }
8 class Derived : public Signal {
10 int Name(void) { return 2; }
13 template <class Foo , int (Foo::*Id)(void)>
17 int value (Foo* a) { return (a->*Id)(); }
20 /* The following line is illegal under the new rules for non-type
21 template arguments in the standard, so it is commented out. */
22 /* template class Bar <Derived, &Signal::Name>; */
23 template class Bar <Signal, &Signal::Name>;
24 template class Bar <Derived, &Derived::Name>;
28 /* Bar<Derived, &Signal::Name> dispatcher1; */
29 Bar<Derived, &Derived::Name> dispatcher2;
32 /* int i1 = dispatcher1.value(&a); */
33 int i2 = dispatcher2.value(&a);
34 return /* i1 != 1 || */ i2 != 2;