Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* DEC C++ template problem
@ 1994-05-16 19:06 Andrew Staniszewski
  1994-05-26 12:34 ` Etienne Frejaville
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Staniszewski @ 1994-05-16 19:06 UTC (permalink / 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
------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1994-05-26 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-05-16 19:06 DEC C++ template problem Andrew Staniszewski
1994-05-26 12:34 ` Etienne Frejaville

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