Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!radar!cadillac!Pkg.Mcc.COM!steve From: steve@Pkg.Mcc.COM (Steve Madere) Newsgroups: comp.lang.c++ Subject: Re: Pointers to overloaded functions Message-ID: <1990Aug29.111702@Pkg.Mcc.COM> Date: 29 Aug 90 16:17:02 GMT References: <1990Aug27.155621@Pkg.Mcc.COM> <424@taumet.com> Sender: news@cadillac.CAD.MCC.COM Reply-To: steve@Pkg.Mcc.COM (Steve Madere) Lines: 32 In article <424@taumet.com>, steve@taumet.com (Stephen Clamage) writes: | steve@Pkg.Mcc.COM (Steve Madere) writes: | | >I need a way to get a pointer to one of a set of overloaded functions. | | >void print(char*); | >void print(int); | >void print(float); | | >printmythingy(v,print,ser1); | | >How do I specify that the print function that I want is the one that goes | >with the char* argument? | | The prototype for printmythingy must show the type of each argument. | Each function of an overloaded set must have a different type. Thus | you can't help but specify that at most one of any overloaded function | set may be used. Example: | | void printmythingy(T1, void(*)(char*), T2); No, no, no. You're missing the whole point. I am creating a function vector table (list of conditions and the function that should be called when the condition is met). I need to install pointers to all sorts of functions into this list. So to be more specific: InstallAction("print",print); InstallAction("remove",remove); is closer to the call that I want to make. But I still want the version of print that takes a char* argument. All I really want is a pointer to this damned function. Isn't there a well defined way of doing this?