Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-08-28 11:20:02


At Tuesday 2002/08/27 12:25, you wrote:
>True, but I fail to see how co-dependent headers is ever the correct way to
>implement something.

I never saw the "common" use for being able to #include the same file more
than once.
If there really IS a meaningful usage, THAT should have been the one to do
the extra work, not the common stuff.
... for all the effort they went to make C "terse" they sure messed up in
this case

>----- Original Message -----
>From: David Bergman
>Newsgroups: gmane.comp.lib.boost.devel
>Sent: Tuesday, 2002:August:27 15:15
>Subject: RE: #ifndef paradigm
>
>
>Eric,
>
>What about a mutually recursive system, w.r.t. prepocessor file
>inclusion? I.e, what about
>
>code1.hpp:
>
>#include "code2.hpp"
>
>class code1 {
>public:
>code1(code2* other) {}
>private:
>int var;
>};
>
>code2.hpp:
>
>#include "code1.hpp"
>
>class code2 {
>public:
>code2() { };
>private:
>int var;
>};
>
>???
>
>You need to #define the token before entering this mutually recursive
>system...
>
>/David
>
>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Eric Woodruff
>Sent: Tuesday, August 27, 2002 2:59 PM
>To: boost
>Subject: [boost] #ifndef paradigm
>
>
>Often, when one wants to make sure a header is included only once, s/he
>uses the paradigm:
>
>#ifndef HEADER_NAME_H__
>#define HEADER_NAME_H__
>
>// code here...
>
>#endif // HEADER_NAME_H__ -- this comment is to make it clear what the
>endif is for
>
>
>It is better to remove the duality of the comment at the end, by
>switching to this paradigm:
>
>
>#ifndef HEADER_NAME_H__
>
>// code here...
>
>#define HEADER_NAME_H__
>#endif
>
>
>When maintiaining a file -- renaming it -- with the comment, one has to
>make sure the comment is also updated. This alternative removes the
>comment because it is superfluous, and the compiler will help you if you
>forget to change the #define at the end.
>
>_______________________________________________
>Unsubscribe & other changes:
>http://lists.boost.org/mailman/listinfo.cgi/boost
>
>_______________________________________________
>Unsubscribe & other changes:
>http://lists.boost.org/mailman/listinfo.cgi/boost
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk