openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Compiling with gcc4.0.1 - compilation error andfix


From: Kevin Wheatley
Subject: Re: [Openexr-devel] Compiling with gcc4.0.1 - compilation error andfix
Date: Tue, 19 Jul 2005 09:19:20 +0100

Florian Kainz wrote:
> 
> Thank you for pointing this out.  I think this is a bug in
> gcc 4.0.1; you should probably report it to the gcc maintainers.
> 

I don't think it is a bug, at least according to the C++ standard. If
no Image is in scope at the point of the friend declaration, it is
going to inject the Image class into the ImageChannel scope. This is
different to the pre-standard ARM, where it would have injected it
into the innermost non class scope (from memory my ARM is at home :-)

I think you need the class friend forward declaration in the enclosing
scope.

Kevin

> > ....
> >
> > #include <map>
> >
> > class Image; <--------------- ********* Add this line ***********
> >
> > class ImageChannel
> > {
> > public:
> >
> > friend class Image;
> >
> > ImageChannel (Image &Image);
> > virtual ~ImageChannel();
> >
> > virtual Imf::Slice slice () const = 0;
> >
> > Image & image () {return _image;}
> > const Image & image () const {return _image;}
> >
> > private:
> >
> > virtual void resize (int width, int height) = 0;
> >
> > Image & _image;
> > };

-- 
| Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this      |
| Senior Technology                     | My employer for certain |
| And Network Systems Architect         | Not even myself         |




reply via email to

[Prev in Thread] Current Thread [Next in Thread]