Re: Eliminating private members from header files
On Jul 14, 2:21 am, Medvedev <3D.v.Wo...@gmail.com> wrote:
When i make a dynamic link library is it allowed to eliminate the
private data members of the classes from the header file which i offer
to the client ?!!
No. When the client links includes your object code in his
program, be it by dynamic linking or static, the class
definition his code sees must be identical with that you used to
compile your code. The only thing you can possibly remove from
it is comments. (The identity is required at the token level.)
In practice, you can usually get away with a few things---private
static data members, for example---but as far as the language is
concerned, as soon as the token sequence is not identical in all
translation units, you have undefined behavior.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34