[PD-dev] Re: PDContainer compiling issue

Georg Holzmann grhPD at gmx.at
Mon Jun 27 11:54:34 CEST 2005


Hallo!

> might be a problem with gcc 3.4, that's much stricter with the c++ standard
> than earlier gcc versions ...

okay, I found the problem:

<problem>
In a template definition, unqualified names will no longer find members 
of a dependent base (as specified by [temp.dep]/3 in the C++ standard). 
For example,

	template <typename T> struct B {
	  int m;
	  int n;
	  int f ();
	  int g ();
	};
	int n;
	int g ();
	template <typename T> struct C : B<T> {
	  void h ()
	  {
	    m = 0; // error
	    f ();  // error
	    n = 0; // ::n is modified
	    g ();  // ::g is called
	  }
	};

You must make the names dependent, e.g. by prefixing them with this->. 
Here is the corrected definition of C<T>::h,

	template <typename T> void C<T>::h ()
	{
	  this->m = 0;
	  this->f ();
	  this->n = 0
	  this->g ();
	}
</problem>

So I have to write a lot of "this" ... :)

LG
Georg




More information about the Pd-dev mailing list