Re: Re: Compilation of arts on HPUX - namespace problems?
Michael Matz <[email protected]>
| Newsgroups | gmane.comp.kde.non-linux |
|---|---|
| Message-ID | <[email protected]> |
Hi, On Thu, 11 Apr 2002, Harri Porten wrote: > > Error 283: "common.h", line 84 # Illegal operand type in call expression. > > ObjectReference reference(buffer); > > ^^^^^^^^^ > > According to my understanding, a class needs to be declared (not defined) > > before it is referenced elsewhere. So the error message does not seem to make > > sense to me. > > My interpretation is different: as an object of type ObjectReference is > instanciated the compiler has to see the full definition. As > ObjectReference is only defined in a header that includes common.h I think > the compiler is right and the problem would be non-trivial to fix. You would be right, if this weren't a template function. Only when instantiating it the full definition of ObjectReference is needed. Classes used in a template do not have to be known yet, just forward-declared. I.e. it's a compiler bug I would say. Ciao, Michael.