bitset 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /******************************************************************************/
  2. /* This file was taken from STLport <www.stlport.org> and modified by */
  3. /* Texas Instruments. */
  4. /******************************************************************************/
  5. /*
  6. * Copyright (c) 1998
  7. * Silicon Graphics Computer Systems, Inc.
  8. *
  9. * Copyright (c) 1999
  10. * Boris Fomitchev
  11. *
  12. * Copyright (c) 2014-2014 Texas Instruments Incorporated
  13. *
  14. * This material is provided "as is", with absolutely no warranty expressed
  15. * or implied. Any use is at your own risk.
  16. *
  17. * Permission to use or copy this software for any purpose is hereby granted
  18. * without fee, provided the above notices are retained on all copies.
  19. * Permission to modify the code and to distribute modified code is granted,
  20. * provided the above notices are retained, and a notice that the code was
  21. * modified is included with the above copyright notice.
  22. *
  23. */
  24. #ifndef _STLP_BITSET
  25. // This implementation of bitset<> has a second template parameter,
  26. // _WordT, which defaults to unsigned long. *YOU SHOULD NOT USE
  27. // THIS FEATURE*. It is experimental, and it may be removed in
  28. // future releases.
  29. // A bitset of size N, using words of type _WordT, will have
  30. // N % (sizeof(_WordT) * CHAR_BIT) unused bits. (They are the high-
  31. // order bits in the highest word.) It is a class invariant
  32. // of class bitset<> that those unused bits are always zero.
  33. // Most of the actual code isn't contained in bitset<> itself, but in the
  34. // base class _Base_bitset. The base class works with whole words, not with
  35. // individual bits. This allows us to specialize _Base_bitset for the
  36. // important special case where the bitset is only a single word.
  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. #ifndef _STLP_OUTERMOST_HEADER_ID
  42. # define _STLP_OUTERMOST_HEADER_ID 0x2
  43. # include <s__prolog.h>
  44. # define _STLP_BITSET
  45. #endif
  46. #if (_STLP_OUTERMOST_HEADER_ID == 0x2)
  47. # ifndef _STLP_INTERNAL_BITSET
  48. # include <s__bitset.h>
  49. # endif
  50. #endif
  51. #if (_STLP_OUTERMOST_HEADER_ID != 0x2) || defined (_STLP_IMPORT_VENDOR_STD)
  52. # if defined (_STLP_HAS_INCLUDE_NEXT)
  53. # include_next <bitset>
  54. # else
  55. # include _STLP_NATIVE_HEADER(bitset)
  56. # endif
  57. #endif
  58. #if (_STLP_OUTERMOST_HEADER_ID == 0x2 )
  59. # include <s__epilog.h>
  60. # undef _STLP_OUTERMOST_HEADER_ID
  61. #endif
  62. #endif /* _STLP_BITSET */
  63. // Local Variables:
  64. // mode:C++
  65. // End: