I also thought ::X::y and X::y to be analogous, like an alias...
but maybe X::y is relative to current namespace
rather than relative to root namespace and thus ::X::y is not the
same of X::y
pd <eukelade@gmail.com> wrote:
I also thought ::X::y and X::y to be analogous, like an alias...
No, those two are not analogous.
but maybe X::y is relative to current namespace
It is. So X::y will only resolve to ::X::y provided you do not have a
sub X namespace in your current namespace.
rather than relative to root namespace and thus ::X::y is not the
same of X::y
No, those two are not identical. X::y just ends up finding ::X::y
because of the namespace name lookup rules, and then only when you
don't have an X namespace below where you are.
If you have this
::X
Then in ::X just Y will look for ::Y as part of the name resolution.
But if you have this:
::X::Y
Then when in ::X, just Y will find ::X::Y and not ::Y (even if you also
have a ::Y).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 497 |
Nodes: | 16 (2 / 14) |
Uptime: | 68:37:36 |
Calls: | 9,766 |
Calls today: | 7 |
Files: | 13,747 |
Messages: | 6,186,073 |