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