<br><br><div class="gmail_quote">2008/6/5 Russ P. <<a href="mailto:Russ.Paielli@gmail.com">Russ.Paielli@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Jun 5, 12:20 pm, Roy Smith <<a href="mailto:r...@panix.com">r...@panix.com</a>> wrote:<br>
<br>
> All somebody has to do to get at the private data is:<br>
><br>
> #define private public<br>
> # include <MySecretClass.h><br>
> #undef private<br>
<br>
</div>Well, that shows the weakness of the C/C++ header files. The "include"<br>
directive merely does a simple text substitution, which is pretty lame<br>
as far as I am concerned. As you say, Java has moved beyond that, and<br>
Ada has always been more sophisticated than that.<br>
<br>
By the way, my recollection is that in C++ access defaults to private<br>
if nothing is declared explicity. So normally the "private"<br>
declaration is unnecessary. If it is left out, your little trick won't<br>
work. But your point is still valid.<br>
</blockquote></div><br>And also<br><br>#define class struct<br>#include "something.h"<br>#undef class<br><br>;)<br><br clear="all">Matthieu<br>-- <br>French PhD student<br>Website : <a href="http://matthieu-brucher.developpez.com/">http://matthieu-brucher.developpez.com/</a><br>
Blogs : <a href="http://matt.eifelle.com">http://matt.eifelle.com</a> and <a href="http://blog.developpez.com/?blog=92">http://blog.developpez.com/?blog=92</a><br>LinkedIn : <a href="http://www.linkedin.com/in/matthieubrucher">http://www.linkedin.com/in/matthieubrucher</a>