a few questions about the iostream source code

Wanting to view the source code for iostream, I open the header file, and attempt to see what's going on. Several questions pop up and I was wondering if anyone could answer them:

When some files are included, they are written as #include <bits/someName>. What does the "bits/" mean?

Is there a way to view the code without all the damn typedefs? I realize they help the coders to code the file, but if I'm trying to figure out how it works, I don't want to go chasing around for all the typedef statements.

What does the @ symbol mean in comments?

One-line comments with three slashes (" /// ") are syntax highlighted differently, and the so are the block comments with two stars (" /** "). Some programs that syntax highlight don't do this though, I'm just wondering what's going on.

Finally, what do two underscores in a typedef'd name mean?

Anyway, I realize I'm probably not going to figure out the ENTIRE iostream library, but I would like to see how some of the functions work and maybe the overloaded >> operator. Thanks
Last edited on
@ -symbol means a code documention keyword in comments (not an official definition). Here are some of them:

1
2
3
4
5
6
7
8
9
@brief
@class
@def
@if
@namespace
@param
@see
@retval
@return


You can also use \-symbol instead of @ -symbol.

In order to use this kind of documentation style in comments, you must use triple slashes (///) in front of these "documentation keywords". /** -marking is just another commentation style, like /*.

There are many different markings in comments. They are useful, because in some text editors (Notepad++ etc.) or IDEs (Code::Blocks etc.) they highlight parts of comments differently. For example in Code::Blocks, comment starting with double slashes (//) looks bit different compared to triple slashed (///) comment. There is no difference in both behaviour or functionality.

Speaking of underscores, they are usually there just so you know that they are not for common use or are preprocessor-related. Here some examples of them:

1
2
_GLIBCXX_IOSTREAM
_GLIBCXX_USE_WCHAR_T


See? You most likely will never use these definitions. The underscore helps you to detect which definitions you should not use. However, there some exceptions, like these:

1
2
3
4
__APPLE__
__cplusplus
__MINGW32__
_WIN32


Oh, and bits/ in include guards refers to folder containing an include file.

Standard libraries are supposed to be used & not supposed modified. The main goal in standard libraries is not the overall look of the code, it's the functionality of it. That's why they often look "messy".
What does the "bits/" mean?
It's a relative path.

Is there a way to view the code without all the damn typedefs?
Not unless you have a smart editor.

What does the @ symbol mean in comments?

One-line comments with three slashes (" /// ") are syntax highlighted differently, and the so are the block comments with two stars (" /** "). Some programs that syntax highlight don't do this though, I'm just wondering what's going on.
These are all special notations for automatic documentation generators.

Finally, what do two underscores in a typedef'd name mean?
Nothing special. They're just a way to mark that the symbol is not public. I.e. it's used internally by the library.
Now remember HH (for helios & me).
Last edited on
SOrry to get back so late, but thanks a lot!
--please mark us solved--
Last edited on
Topic archived. No new replies allowed.