![]() |
namespace alias?
How to use it correctly?
I have a header where I put :
namespace out {Now how do I make "namespace alias" in cpp file? Trying: :
namespace new = out::in;doesn't work... Error: :
expected namespace-name before ';' tokencc: gcc 3.4.2 os: windows 2000 Thanks PS: Code compiles when I type full namespace names ... |
I think it's:
:
namespace new = out;As it stands, it looks like your are trying to make a namespace an alias for a class. |
You use the namespaces like this:
:
namespace out |
Ok, thanks... I understand now...
|
He is not trying to make an instance of a class (at least, I don't think he is).
He's trying to make an alias for a namespace. EDIT: I was just proven wrong. :p Why did you say "alias" then, iradic? |
In any case, you don't use 'new' as if it's a variable for assignment, it's a keyword.
|
Confusion all over the place... :)
Jessehk correctly read my mind... Thanks again bye.. PS: I will edit original post. |
Edit doesn't show in my first post?
|
You can't edit after 30 minutes. Regarding editing, it's better if you ADD or EXPLAIN things in a edit (other than typos, of course), after responses have been received, so that the original meaning of the thread doesn't go south.
|
| All times are GMT -5. The time now is 1:33 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC