8sa1-gcc/gcc/testsuite/g++.old-deja/g++.mike/pmf7.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

30 lines
413 B
C

class A;
typedef int (A::*f_ptr) (void);
class B {
public:
B() {}; ~B() {};
B& dummy(f_ptr cb) { return *this; };
};
template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
sp->dummy(cb);
return *sp;
};
class A {
public:
A() {}; ~A() {};
int ok() { return 0; };
A& call_it(B* s) {
call_dummy(s, &A::ok);
return *this;
};
};
int main() {
A a; B b;
a.call_it(&b);
return 0;
}