containment of standard c++ classes

P

pauldepstein

Does anyone know ( giving a URL is obviously o.k.) which of the C++
classes contain each other?

(For example, <fstream> contains <iostream> [I think]).

This did sound to me a bit like a FAQ question so I googled around a
bit, but couldn't find it. Apologies if it's a FAQ.

Paul Epstein

P.S. Maybe I should have said "FA question" instead of "FAQ question."
But I don't think so because Americans talk about "ATM machines". No
one ever says "AT machines".
 
B

Bo Persson

Does anyone know ( giving a URL is obviously o.k.) which of the C++
classes contain each other?

The standard just says that a header may include other headers. It
doesn't give a list of which ones.

The intention seems to be that all names used in a header should be
defined as needed, so that a file containing just

#include <some-header>

should compile. It is up to each implementation to ensure that it
does.

(For example, <fstream> contains <iostream> [I think]).

I don't think so. :)

It might include <istream> and <ostream>, but we cannot be sure.



Bo Persson
 
J

Jim Langston

Does anyone know ( giving a URL is obviously o.k.) which of the C++
classes contain each other?

(For example, <fstream> contains <iostream> [I think]).

This did sound to me a bit like a FAQ question so I googled around a
bit, but couldn't find it. Apologies if it's a FAQ.

Paul Epstein

P.S. Maybe I should have said "FA question" instead of "FAQ question."
But I don't think so because Americans talk about "ATM machines". No
one ever says "AT machines".

It's implementation dependant, and I presume you meant "headers" and not
"classes".

<fstream> is a header file that (probably) contains templates and (probably)
class definitions.

Each compiler has it's own standard headers and they are all pretty much
different, although there are usually similarities. On one compiler
<fstream> may include <iostream> and on another compiler it may not.
 

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,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top