Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Then why not derive it from the used namespace? Is that because you do not necessarily use only a single namespace per file which could make creating the macro name tricky? Or because in order to know the namespace, the compilation process has to start, which happens after preprocessor "applies" the header guards, which in turn would make some kind of double compilation necessary? Good old C++ feels somewhat clumsy in this regard compared to how C# or java handle the inclusion of other files. Commented Sep 13, 2016 at 22:07
  • @null I forgot that part - I do that when I use namespaces, which I generally do even when writing a regular program as opposed to a library. Commented Sep 13, 2016 at 23:01