Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: stan@chirpa.mayo.edu (Andrew Staniszewski)
Subject: DEC C++ template problem
Date: 16 May 1994 19:06:34 GMT	[thread overview]
Message-ID: <2r8g7q$gsq@fermat.mayo.edu> (raw)



I need to write some code taking advantage of the flexability of templates. 
But the DEC C++ compiler is being rather noisome. My specific problem 
lies in passing a member function from a paramatized type, specificly

-----------------------------------------------------------------------------
include <iostream.h>
class foo
{
public:
  int barr() { return 0;}
};

template <class type> int func(type data,int (type::*memberFunc)())
{
  return data.memberFunc();
}


void main()
{
  foo data;

  cout << func(data,&foo::barr) << endl;
}
--------------------------------------------------------------------------------


generates the message from the compiler

chirpa> cxx -c test.cxx
	test.cxx:8: error: In the declaration of "memberFunc", type is not a class, 
	struct, or union type.
	Compilation terminated with errors.
The only way I can get this to compile is to declare memberFunc to belong 
explicily to foo. I THINK this is a compiler bug, but can anyone tell me for sure?

-- 
------------------------------------------------------------------------------
Andrew Staniszewski
staniszewski@mayo.edu
------------------------------------------------------------------------------


             reply	other threads:[~1994-05-16 19:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-05-16 19:06 Andrew Staniszewski [this message]
1994-05-26 12:34 ` DEC C++ template problem Etienne Frejaville
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox