|
1 /* |
|
2 * Copyright (c) 1998 |
|
3 * Silicon Graphics Computer Systems, Inc. |
|
4 * |
|
5 * Copyright (c) 1999 |
|
6 * Boris Fomitchev |
|
7 * |
|
8 * This material is provided "as is", with absolutely no warranty expressed |
|
9 * or implied. Any use is at your own risk. |
|
10 * |
|
11 * Permission to use or copy this software for any purpose is hereby granted |
|
12 * without fee, provided the above notices are retained on all copies. |
|
13 * Permission to modify the code and to distribute modified code is granted, |
|
14 * provided the above notices are retained, and a notice that the code was |
|
15 * modified is included with the above copyright notice. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef _STLP_BITSET |
|
20 #define _STLP_BITSET |
|
21 |
|
22 // This implementation of bitset<> has a second template parameter, |
|
23 // _WordT, which defaults to unsigned long. *YOU SHOULD NOT USE |
|
24 // THIS FEATURE*. It is experimental, and it may be removed in |
|
25 // future releases. |
|
26 |
|
27 // A bitset of size N, using words of type _WordT, will have |
|
28 // N % (sizeof(_WordT) * CHAR_BIT) unused bits. (They are the high- |
|
29 // order bits in the highest word.) It is a class invariant |
|
30 // of class bitset<> that those unused bits are always zero. |
|
31 |
|
32 // Most of the actual code isn't contained in bitset<> itself, but in the |
|
33 // base class _Base_bitset. The base class works with whole words, not with |
|
34 // individual bits. This allows us to specialize _Base_bitset for the |
|
35 // important special case where the bitset is only a single word. |
|
36 |
|
37 // The C++ standard does not define the precise semantics of operator[]. |
|
38 // In this implementation the const version of operator[] is equivalent |
|
39 // to test(), except that it does no range checking. The non-const version |
|
40 // returns a reference to a bit, again without doing any range checking. |
|
41 |
|
42 # ifndef _STLP_OUTERMOST_HEADER_ID |
|
43 # define _STLP_OUTERMOST_HEADER_ID 0x2 |
|
44 # include <stl/_prolog.h> |
|
45 # endif |
|
46 |
|
47 #ifdef _STLP_PRAGMA_ONCE |
|
48 # pragma once |
|
49 #endif |
|
50 |
|
51 # include <stl/_bitset.h> |
|
52 |
|
53 # if (_STLP_OUTERMOST_HEADER_ID == 0x2 ) |
|
54 # include <stl/_epilog.h> |
|
55 # undef _STLP_OUTERMOST_HEADER_ID |
|
56 # endif |
|
57 |
|
58 #endif /* _STLP_BITSET */ |
|
59 |
|
60 |
|
61 // Local Variables: |
|
62 // mode:C++ |
|
63 // End: |
|
64 |