Re: 3.2.2 vs. 3.3.2 - forward declaration

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

 



Hi Ilja,

I think your code is running into a situation analogous to this one (see code below), but regarding templates instead of simple structures...

//------------------------------------------
class Foo;

struct Bar
{
        Foo foo; // error: field `foo' has incomplete type
};

class Foo
{
public:
        int i;
};

int main()
{
        Bar bar;
}
//------------------------------------------

If you declare the class before you instantiate it, it doesn't generate the error.

I'm not sure of the relevant ISO 14882 reference to cite, but I'd bet that there's one in there that addresses the situation you've run into.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux