Home » Developing U++ » U++ Developers corner » How to manage UPP namespace
Re: How to manage UPP namespace [message #43085 is a reply to message #43084] |
Sun, 04 May 2014 07:56 |
|
Hi Didier,
I agree that there should NEVER be "using namespace" in header that is meant to be used by others. I don't really care if some code is in Upp namespace and some in global, sometimes it is hard to tell whether it is really part of U++, e.g. for packages in bazaar, it is kind of blurry line.
Another related thing related to namespaces that I would like to point out is the existence of NONAMESPACE flag. It can be used to move all U++ code to global namespace, which might be preferable for someone who doesn't like to deal with "using namespace Upp;" in every file. But for this flag to work, all the code must use correct macros, defined in Core.h:#ifdef flagNONAMESPACE
#define NAMESPACE_UPP
#define END_UPP_NAMESPACE
#define UPP
#else
#define NAMESPACE_UPP namespace Upp {
#define END_UPP_NAMESPACE };
#define UPP Upp
#endif
There is a lot of code (some even in Core IIRC), that does not follow this convention, making NONAMESPACE flag useless.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Fri May 10 08:01:08 CEST 2024
Total time taken to generate the page: 0.01962 seconds
|