help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unique identifiers for guard macros


From: Angel Tsankov
Subject: Re: unique identifiers for guard macros
Date: Wed, 5 Apr 2006 14:35:18 +0300

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.

You needn't be sorry for asking - I just had to be more specific, I guess.
In a large project it is possible to have duplicate file names in different folders (and in different namespaces). This is why it is better to have some other way to form the guard.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]