On 6/15/07, Mark Mitchell <[EMAIL PROTECTED]> wrote:
I don't think there's a contradiction. The declaration on the structure is the default for the members and applies to the vtable and other class data. There's no reason the members shouldn't be implemented elsewhere, and there's certainly existing code (in Windows, SymbianOS, and other DLL-based operating systems, whether or not there is on GNU/Linux) that implements different class members in different DLLs, while still not exporting the class from its home DLL. One situation where this is useful is when the class members are actually shared between multiple classes, or are also callable as C functions, etc.
Well this allows for easier violating of ODR. I guess I am just a bit off of what is going on here but I agree with Chris in that this really should be rejected as you have stuff which is hidden and then you call a non hidden member function. How can the vtable be hidden while the member functions not be? I think if you try to throw that class across boundaries, it will never be caught as the typeinfos are different. So really I think this is just bad pratice and should at least get a warning, even though code in real life exists, the code is broken to say the least. -- Pinski