473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Eliminating private members from header files

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 ?!!
Jul 14 '08 #1
2 1729
On Jul 14, 2:21 am, Medvedev <3D.v.Wo...@gmail.comwrote:
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:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 14 '08 #2
Stefan Ram wrote:
Medvedev <3D********@gmail.comwrites:
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 ?!!

See also

http://en.wikipedia.org/wiki/Opaque_pointer#C.2B.2B
http://www.gotw.ca/gotw/028.htm
http://www.gotw.ca/gotw/024.htm
very helpful links , thanks
Jul 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Corno | last post by:
Hi all, I was just wondering why a class declaration also includes the private members of a class. Is this information needed by other classes for compiling and/or linking or is this just an...
8
by: CoolPint | last post by:
I read in books that nested class cannot access private members of nesting class and vice versa unless they are made friends. Somehow, my compiler is letting my nested class member functions access...
6
by: Simon Elliott | last post by:
(Note: this is a real C++ question and not an MS Windows question. The window handle I introduce is just an example of OS specific data, which I've used to illustrate my question.) I have some...
6
by: harry | last post by:
Hi ppl I have a question about memory layout of a class. Consider the code below: class Base1 { virtual void f() { cout << "Base1::f" << endl; } virtual void g() { cout << "Base1::g" <<...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.