Question about namespaces
Question about namespaces
I noticed that in most examples ony one namespace is used globaly, other namespaces are written in front of functions. But using all 6 namespaces globaly is more comfortable i say. But examples are written by much better programmers than me. So is there any difference?
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
I usually open the namespaces only in cpp files and leave all types in headers fully scoped. This way there is no danger of name collision across includes, and in the cpp file itself, this is easy to resolve.
And I never open std, but always use it explicitly. Their names are very generic and the namespace name itself is short enough, to not make this awkward.
And I never open std, but always use it explicitly. Their names are very generic and the namespace name itself is short enough, to not make this awkward.
Yes, try to use all Irrlcht namespaces before #include <windows.h>...roxaz wrote:aha, so there may be some name usage problems, i see now. last day i tried to use list in my project. it ended with lots of errors and no success. i gues this was std namespace problem... great that you mentioned it, thx
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
yeah well there can be many files in a final project and if you're anything like me you compile 50 times after changing one letter.Saturn wrote:By about 0.01µs per file...
or the classic oops forgot to tweak that or change that compile again oops another thing I missed and end up compiling a million times to look at the work for less then ten seconds lol.
I use all irrlicht namespaces once globally for small projects.