efrat wrote:
[EMAIL PROTECTED] wrote:
Why do you need unique guards? The reason why header guards are used is
to prevent multiple inclusion of a file so the macros are based on the
file name.
For example, foo.h would have:
#ifndef FOO_H
#define FOO_H
#endif
Sorry if this isn't very helpful, but I don't see why you would need
unique guards.
Regards,
Ryan Mansfield
FWIW, I think that MS agrees with you: in VC++, you can write
#pragma once
at the top of a file instead of guards.
I guess that g++ is more hesitant to extend the language (for which MS
is notorious). Since the preprocessor can do the trick (through unique
guards), then that's that. Generating unique names sure is annoying,
though. I try to include into the guard some information that includes
both the file name, and the directory structure relative to the
project's base directory.
Come to think of it, it seems that g++ supports #pragma once as well:
http://gcc.gnu.org/gcc-3.4/changes.html
That should solve your problem, no?
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus