[comp.lang.c++] obtaining "this" when passing method by reference

dsa@dlogics.UUCP (David Angulo) (08/17/89)

When I compile the following file, I get an error that "a1" in routine "add" is
undefined.  Is there any way that I can tell routine "add" that "a1" refers to
the "this" that was defined when "xtern_funct" was called?  (By the way, I
have no control over "xtern_funct").



void xtern_funct ( auto void (*)() );


class a
	{
	int a1;
    public:
	friend void add();
	a() {xtern_funct (add);}
	};

void add()
	{a1++;}