This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bits Question


On 2 Jan 2010, at 07:50, Kip Warner wrote:

> Greetings,
> 
> I am finding the acronym "bits" all over the place, and presumably not
> the "Binary digIT" kind, in libstdc++.
> 
> Examples are:
> /usr/include/c++/4.4/x86_64-linux-gnu/32/bits/
> /usr/include/c++/4.4/bits/
> 
> As well as non-libstdc++, such as...
> /usr/include/bits
> 
> I am just curious. It looks like platform specific stuff, but I am not
> certain. What does it stand for and when would a developer typically
> use such a directory in their source tree for a given project?

'bits' is not platform specific, but more internal details and organisation. You shouldn't be including these headers directly, they are all included by the appropriate proper headers. As an example, all the <algorithm> header does is:

#include <bits/stl_algobase.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_algo.h>

stl_algobase.h for example contains a small set of algorithms which are used in many places (swap, min, max, copy, etc.), so other headers can only include the parts of <algorithm> they need.

Of course, you should NEVER include any of those headers directly, there is no attempt to make sure you can include any of these headers directly.

Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]