Re: Does anyone know what this text means? (related to C4251 warning)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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


.



Relevant Pages

  • Re: BARRY & THE BROTHERS TO THE RESCUE SHOOTDOWN
    ... [snip portions of Kenny's posting already debunked here, ... It is an "advisory" NOT a warning to depart or not enter. ... warnings prior to the flight. ... >>> Look at the LOGS Danny they state the EXACT times. ...
    (soc.culture.cuba)
  • Re: Identify source of warning
    ... post because I wasn't saying I thought using undef there was the way ... I did that to try to trip the same warning output. ...
    (perl.beginners)
  • Re: Another fun morning with Yankee
    ... Suddenly, without warning, Sue Leopold exclaimed: ... fairly impressive length of stride - would love to hear from y'all what ... Well, of course, but s you know he came thin, sick, wormy and probably depressed. ...
    (rec.equestrian)
  • Re: 2 problems parsing output from HTML::TableExtract
    ... characters in the string that, while not a problem in browsers ... Here is the code block the warning relates to: ... foreach $ts { ...
    (comp.lang.perl.misc)