Re: Does anyone know what this text means? (related to C4251 warning)
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 1 Nov 2007 17:45:41 -0500
"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:pbcki3p750upnqmsi78sdb1a91qep4kvjo@xxxxxxxxxx
On Thu, 1 Nov 2007 08:38:35 -0500, "Ben Voigt [C++ MVP]"
<rbv@xxxxxxxxxxxxx> wrote:
BTW David's way is what the article is referring to. Inheritance is done
via aggregation and implementing the same public interface.
That's not "inheritance" in the C++ sense of the word.
It isn't type derivation, but it is inheritance in the OOP sense of the
word.
[snip]
Doug's way, although it might avoid the warning, does all the things the
warning is designed to discourage (exports class members, violates
one-definition rule, etc).
It doesn't just "avoid the warning". What I talked about in the last
paragraph of my message lets you use the class as a real C++ class,
instead
of some clumsy COM simulation. Not everything is a nail.
That's misleading. What you could say is "it's a real Visual C++ 8.0 class
dynamically linking the debug runtime library, with 4-byte packing, and
STL_CHECKED_ITERATORS=0"... if those are in fact the compiler options used.
Whereas the source code for a real C++ class can be used in any C++ program
and compiled with any C++ standard-compliant compiler.
[snip]
Where did what I posted violate the ODR, BTW?
The definition of class X is different between the provider and consumer.
Every single use of dllimport/dllexport on a type violates the ODR.
Sometimes you can get away with it, sometimes not.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: Does anyone know what this text means? (related to C4251 warning)
- From: Doug Harrison [MVP]
- Re: Does anyone know what this text means? (related to C4251 warning)
- References:
- Does anyone know what this text means? (related to C4251 warning)
- From: Anonymous
- Re: Does anyone know what this text means? (related to C4251 warning)
- From: Doug Harrison [MVP]
- Re: Does anyone know what this text means? (related to C4251 warning)
- From: David Wilkinson
- Re: Does anyone know what this text means? (related to C4251 warning)
- From: Ben Voigt [C++ MVP]
- Re: Does anyone know what this text means? (related to C4251 warning)
- From: Doug Harrison [MVP]
- Does anyone know what this text means? (related to C4251 warning)
- Prev by Date: Re: Does anyone know what this text means? (related to C4251 warning)
- Next by Date: Re: Is there something like a WebBrowser class?
- Previous by thread: Re: Does anyone know what this text means? (related to C4251 warning)
- Next by thread: Re: Does anyone know what this text means? (related to C4251 warning)
- Index(es):
Relevant Pages
|