About namespace std

3

322322

Could anybody tell where is the namespace std file ? Thanks a lot !
namespace::std{
.....
....
}
 
N

Nick Keighley

Could anybody tell where is the namespace std file ? Thanks a lot !
namespace::std{

since a namespace isn't a file there is no namespace std (abbreviated
to std:: in this post) file. The things that are in std:: such as
std::cout are defined in standard includes

#include <iostream>

these *may* be implemented as files. But the mapping
is not defined by the language definition (possibilities
are iostream and iostream.h).

So since you can't have what you asked for, what do you really
want? Do you want a list of all the names in std::? It will be
huge! All I can suggest is google it.

<pause>

hmmm. maybe not such a good idea. Most hits seemed to be trying
to answer questions like "Why does it hurt when I pee?"
 
3

322322

Nick Keighley $B<LF;!'(B
since a namespace isn't a file there is no namespace std (abbreviated
to std:: in this post) file. The things that are in std:: such as
std::cout are defined in standard includes

#include <iostream>

these *may* be implemented as files. But the mapping
is not defined by the language definition (possibilities
are iostream and iostream.h).

So since you can't have what you asked for, what do you really
want? Do you want a list of all the names in std::? It will be
huge! All I can suggest is google it.

<pause>

hmmm. maybe not such a good idea. Most hits seemed to be trying
to answer questions like "Why does it hurt when I pee?"


Why I can't find the "using namespace std "in <ios>,<iostream> and
<string> ???
Thanks!
 
L

Lionel B

Could anybody tell where is the namespace std file ? Thanks a lot !
namespace::std{
[...]

So since you can't have what you asked for, what do you really want? Do
you want a list of all the names in std::? It will be huge! All I can
suggest is google it.

<pause>

hmmm. maybe not such a good idea. Most hits seemed to be trying to
answer questions like "Why does it hurt when I pee?"

LOL!

Try sticking a "C++" in front of that...
 
L

Lionel B

Nick Keighley 写é“:
since a namespace isn't a file there is no namespace std (abbreviated
to std:: in this post) file. The things that are in std:: such as
std::cout are defined in standard includes

#include <iostream>

these *may* be implemented as files. But the mapping is not defined by
the language definition (possibilities are iostream and iostream.h).

So since you can't have what you asked for, what do you really want? Do
you want a list of all the names in std::? It will be huge! All I can
suggest is google it.
[...]

Why I can't find the "using namespace std "in <ios>,<iostream> and
<string> ???

Why would you expect to find "using namespace std" in those headers? They
don't "use" namespace std, they declare things *in* namespace std. E.g.
if some function `void foo()' in namespace `joe' were declared in some
header, you would expect to see:

namespace joe
{
void foo();
}

in that header. I'd suggest reading about namespaces in a good C++ book.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,498
Latest member
log5Sshell/alfa5

Latest Threads

Top