|
-
September 24th, 2010, 02:01 AM
#1
::std
 Originally Posted by 17.6.1.1 Library contents
3: Whenever a name x defined in the standard library is mentioned, the name x is assumed to be fully qualified as ::std::x, unless explicitly described otherwise. For example, if the Effects section for library function F is described as calling library function G, the function ::std::G is meant.
I was reading the standard, and came across this. I noticed that the std namespace was fully qualified to reference the "global" std namespace. While I realize it is probably overkill to do it in an everyday program ("::std::string myString"), I asked myself this question: Can it even serve a use to fully qualify std? I know the standard makes it illegal to put anything inside the std namespace (except for full template sepcializations), so is there a point?
Can you think of a case where writing ::std would be mandatory?
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|