Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!dlogics!dsa
From: dsa@dlogics.UUCP (David Angulo)
Newsgroups: comp.lang.c++
Subject: obtaining "this" when passing method by reference
Message-ID: <103@dlogics.UUCP>
Date: 16 Aug 89 17:12:15 GMT
Organization: Datalogics, Inc., Chicago, IL
Lines: 21


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++;}