delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/24/19:17:13

Newsgroups: comp.os.msdos.djgpp
From: wolfman AT cedar DOT alberni DOT net
Subject: template function pointers
Message-ID: <a177cd$1418c.186@news.alberni.net>
Date: Fri, 24 Oct 1997 04:24:12 GMT
Lines: 16
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello, I am doing a bit of coding in djgpp and along the way, I wanted to write some 
pixel plotting code using function pointers and templates.  The reasons being that 
with templates there are about 8 pixel plotting functions (this would almost double 
without templates), and I want the user to simply write: Plot_Pixel(x, y, color); in 
order to access any of the plotting functions in any mode (the mode setting function 
assignes the proper function to Plot_Pixel()).  Anyway, this is what I have in the 
header.


template<class col>
extern void (*Plot_Pixel)(short x, short y, col color).


And for some reason, DJGPP tells me on this line that 'Plot_Pixel must be a class 
member' or something along those lines.  Can someone help me pleas.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019