← Back to team overview

yade-dev team mailing list archive

Re: need help on ClumpTemplate

 

>> class ClumpTemplate {
>>           ClumpTemplate ct;


The problem is you are trying to define a class which contains itself,
the compiler goes crazy.
"This is a class that contains an object of the class that contains an
object of the class that contains an object of the class that contains
an object of the class that contains an object of the class..." and so on.

It is in fact possible to write:

class ClumpTemplate {
           ClumpTemplate* ct;

Because you can point to a class even if it is incompletely defined (as
soon as it is declared, actually).
But a real question is, why do you have to do that?

Bruno


Follow ups

References