I would prefer it when it could potentially be ambiguous.
@chrisname I see it as the scope resolution operator, not as connecting two things. I think of it as resolving the scope when it is ambiguous or not clear.
You've just made everything within the name-space static; you won't be able to access them outside of the TU. Was that intentional? I personally don't think it was or else you would've said.
As for the actual question, yes, I only use the SRO prefix when my code is within the global name-space. However, 99% of the time my code resides within a user-defined name-space so I tend to omit the SRO prefix. And no, it's not ugly; it's explicit and I like that.
@Framework
He knows C# so I'm guessing it's because C# uses the . operator for both member access and scope resolution. Like me, he probably prefers how it looks.
He knows C# so I'm guessing it's because C# uses the . operator for both member access and scope resolution. Like me, he probably prefers how it looks.
Exactly. I find that it looks cleaner.
Ah, right. Strange answer though, for a C++ question.
Well he ask if we think its ugly... in short answer; I do.
Edit:
in reality C# is designed differently for that though. because everything has to be inside a namespace, so let say your namespace is Joe; your global variable would be Joe.global
Nothing has to be inside a namespace. You can write a C# program without the word "namespace" appearing anywhere. You just can't put variables and methods outside of a class.
I like being able to tell the difference between instance and static. I hate that you can use the . operator to access static fields, I wish that would go away.
I wouldn't mind InstanceVariable::StaticMember, but then you would get me fussed up about how static class functions should be polymorphic when called from an instance.
Nothing has to be inside a namespace. You can write a C# program without the word "namespace" appearing anywhere. You just can't put variables and methods outside of a class.
Right sorry, inside the class is what I meant, out side of the methods.
However I didn't know you didn't need a namespace. I guess I've never tried to not use one, but I just tested it and yeah, no namespace needed...