38#ifndef _STLP_INTERNAL_ALGOBASE_H
42#ifndef _STLP_INTERNAL_ALLOC_H
46#ifndef _STLP_INTERNAL_ITERATOR_H
50#ifndef _STLP_INTERNAL_UNINITIALIZED_H
54#ifndef _STLP_RANGE_ERRORS_H
58#ifndef _STLP_INTERNAL_STRING_H
62#define __BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
63#define __BITSET_WORDS(__n) ((__n + __BITS_PER_WORD - 1)/__BITS_PER_WORD)
74 static size_t _S_count(
const unsigned char *__beg,
const unsigned char *__end)
75#if defined (_STLP_USE_NO_IOSTREAMS)
78 for (; __beg != __end; ++__beg) {
79 for (
size_t i = 0;
i < (
sizeof(
unsigned char) * 8); ++
i) {
80 if ((*__beg & (1 <<
i)) != 0) { ++__result; }
89 static unsigned char _S_first_one(
unsigned char __x)
90#if defined (_STLP_USE_NO_IOSTREAMS)
92 for (
unsigned char i = 0;
i < (
sizeof(
unsigned char) * 8); ++
i) {
93 if ((__x & (1 <<
i)) != 0) {
return i; }
139 for (
size_t __i = 0; __i < _Nw; __i++ ) {
145 for (
size_t __i = 0; __i < _Nw; __i++ ) {
151 for (
size_t __i = 0; __i < _Nw; __i++ ) {
161 for (
size_t __i = 0; __i < _Nw; __i++ ) {
162 _M_w[__i] = ~_M_w[__i];
167 for (
size_t __i = 0; __i < _Nw; __i++ ) {
175 for (
size_t __i = 0; __i < _Nw; ++__i) {
183 for (
size_t __i = 0; __i < _Nw ; __i++ ) {
191 const unsigned char* __byte_ptr = (
const unsigned char*)
_M_w;
192 const unsigned char* __end_ptr = (
const unsigned char*)(
_M_w+_Nw);
255 const unsigned char* __byte_ptr = (
const unsigned char*)&
_M_w;
256 const unsigned char* __end_ptr = ((
const unsigned char*)&
_M_w)+
sizeof(
_M_w);
265 inline size_t _M_do_find_next(
size_t __prev,
size_t __not_found)
const;
281 for (
size_t __j = 0; __j <
sizeof(
_WordT); __j++ ) {
282 unsigned char __this_byte
283 =
__STATIC_CAST(
unsigned char,(__thisword & (~(
unsigned char)0)));
296 size_t __not_found )
const {
308 __thisword &= (~__STATIC_CAST(
_WordT,0)) << _S_whichbit(__prev);
313 __thisword >>= _S_whichbyte(__prev) *
CHAR_BIT;
314 for (
size_t __j = _S_whichbyte(__prev); __j <
sizeof(
_WordT); __j++ ) {
315 unsigned char __this_byte
316 =
__STATIC_CAST(
unsigned char,(__thisword & (~(
unsigned char)0)));
334 {
__val &= ~((~__STATIC_CAST(
unsigned long,0)) << _Extrabits); }
374 _M_wp = &__b._M_getword(__pos);
375 _M_bpos = _Bitset_base::_S_whichbit(__pos);
393 if ( (*(__j.
_M_wp) & _Bitset_base::_S_maskbit(__j.
_M_bpos)) )
419#if defined (_STLP_MEMBER_TEMPLATES)
420 template<
class _CharT,
class _Traits,
class _Alloc>
424 if (__pos > __s.
size())
429 template<
class _CharT,
class _Traits,
class _Alloc>
434 if (__pos > __s.
size())
441 size_t __n = (
size_t)-1)
443 if (__pos > __s.
size())
451 this->_M_do_and(__rhs);
456 this->_M_do_or(__rhs);
461 this->_M_do_xor(__rhs);
466 this->_M_do_left_shift(__pos);
472 this->_M_do_right_shift(__pos);
489 this->_M_getword(__pos) |= this->_S_maskbit(__pos);
491 this->_M_getword(__pos) &= ~ this->_S_maskbit(__pos);
497 this->_M_getword(__pos) &= ~ this->_S_maskbit(__pos);
502 this->_M_getword(__pos) ^= this->_S_maskbit(__pos);
564 unsigned long to_ulong()
const {
return this->_M_do_to_ulong(); }
566#if defined (_STLP_MEMBER_TEMPLATES) && !defined (_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
567 template <
class _CharT,
class _Traits,
class _Alloc>
581 size_t count()
const {
return this->_M_do_count(); }
583 size_t size()
const {
return _Nb; }
586 return this->_M_is_equal(__rhs);
589 return !this->_M_is_equal(__rhs);
592 bool test(
size_t __pos)
const {
599 bool any()
const {
return this->_M_is_any(); }
600 bool none()
const {
return !this->_M_is_any(); }
604 __result <<= __pos ;
return __result;
608 __result >>= __pos ;
return __result;
611#if !defined (_STLP_NO_EXTENSIONS)
620 {
return this->_M_do_find_first(_Nb); }
624 {
return this->_M_do_find_next(__prev, _Nb); }
630#if defined (_STLP_MEMBER_TEMPLATES)
631 template<
class _CharT,
class _Traits,
class _Alloc>
633 size_t __pos,
size_t __n) {
636 size_t __pos,
size_t __n) {
637 typedef typename string::traits_type _Traits;
641 const size_t __Nbits = (
min) (__tmp, (
min) (
__n, __s.
size() - __pos));
642 for (
size_t __i= 0; __i < __Nbits; ++__i) {
643 typename _Traits::int_type __k = _Traits::to_int_type(__s[__pos + __Nbits - __i - 1]);
652#if defined (_STLP_MEMBER_TEMPLATES)
653 template <
class _CharT,
class _Traits,
class _Alloc>
661 for (
size_t __i = 0; __i < _Nb; ++__i) {
663 __s[_Nb - 1 - __i] =
'1';
667#if !defined (_STLP_MEMBER_TEMPLATES) && !defined (_STLP_NO_WCHAR_T)
669 __s.assign(_Nb,
'0');
671 for (
size_t __i = 0; __i < _Nb; ++__i) {
673 __s[_Nb - 1 - __i] =
'1';
678#if defined (_STLP_NON_TYPE_TMPL_PARAM_BUG)
701#if ! defined (_STLP_NON_TYPE_TMPL_PARAM_BUG)
730#if !defined (_STLP_USE_NO_IOSTREAMS)
734# if !(defined (_STLP_MSVC) && (_STLP_MSVC < 1300)) && \
735 !(defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x500))
737#ifndef _STLP_INTERNAL_IOSFWD
743template <
class _CharT,
class _Traits,
size_t _Nb>
747template <
class _CharT,
class _Traits,
size_t _Nb>
753#ifndef _STLP_STRING_IO_H
762 typedef typename string::traits_type _Traits;
767 typename istream::sentry __sentry(__is);
770 for (
size_t __i = 0; __i < _Nb; ++__i) {
771 static typename _Traits::int_type __eof = _Traits::eof();
773 typename _Traits::int_type __c1 = __buf->
sbumpc();
774 if (_Traits::eq_int_type(__c1, __eof)) {
779 typename _Traits::char_type __c2 = _Traits::to_char_type(__c1);
782 if (
__c ==
'0' ||
__c ==
'1')
784 else if (_Traits::eq_int_type(__buf->
sputbackc(__c2), __eof)) {
805 return __os << __tmp;
808# if !defined (_STLP_NO_WCHAR_T)
813 typedef typename wstring::traits_type _Traits;
821 for (
size_t __i = 0; __i < _Nb; ++__i) {
822 static typename _Traits::int_type __eof = _Traits::eof();
824 typename _Traits::int_type __c1 = __buf->
sbumpc();
825 if (_Traits::eq_int_type(__c1, __eof)) {
830 typename _Traits::char_type __c2 = _Traits::to_char_type(__c1);
833 if (
__c ==
'0' ||
__c ==
'1')
834 __tmp.push_back(
__c);
835 else if (_Traits::eq_int_type(__buf->
sputbackc(__c2), __eof)) {
856 return __os << __tmp;
869#undef __BITS_PER_WORD
872#if !defined (_STLP_LINK_TIME_INSTANTIATION)
_STLP_INLINE_LOOP _InputIter const _Tp & __val
bitset< _Nb > _STLP_CALL operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
bitset< _Nb > _STLP_CALL operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
#define __BITSET_WORDS(__n)
bitset< _Nb > _STLP_CALL operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
_STLP_THROW_FUNCT_SPEC _STLP_CALL __stl_throw_invalid_argument(const char *__msg)
_STLP_THROW_FUNCT_SPEC _STLP_CALL __stl_throw_out_of_range(const char *__msg)
static unsigned char _S_first_one(unsigned char __x)
static size_t _S_count(const unsigned char *__beg, const unsigned char *__end)
basic_streambuf< _CharT, _Traits > * rdbuf() const
void setstate(iostate __state)
char narrow(_CharT, char) const
int_type sputbackc(char_type __c)
void reserve(size_type=0)
_Self & assign(const _Self &__s)
void push_back(_CharT __c)
bitset< _Nb > & _Unchecked_set(size_t __pos, int __val)
bitset< _Nb > & flip(size_t __pos)
bitset< _Nb > operator~() const
_STLP_PRIV _Base_bitset< _Words > _Base
size_t _Find_next(size_t __prev) const
bitset< _Nb > operator>>(size_t __pos) const
bitset< _Nb > & operator>>=(size_t __pos)
bitset< _Nb > & reset(size_t __pos)
bitset< _Nb > operator<<(size_t __pos) const
void _M_copy_from_string(const string &__s, size_t __pos, size_t __n)
bitset(unsigned long __val)
bitset< _Nb > & set(size_t __pos, int __val)
bitset< _Nb > & _Unchecked_set(size_t __pos)
bitset< _Nb > & _Unchecked_reset(size_t __pos)
unsigned long to_ulong() const
void _M_copy_to_string(string &__s) const
bitset< _Nb > & set(size_t __pos)
void _M_copy_to_string(wstring &__s) const
size_t _Find_first() const
bool operator!=(const bitset< _Nb > &__rhs) const
bitset< _Nb > & operator^=(const bitset< _Nb > &__rhs)
bitset< _Nb > & operator|=(const bitset< _Nb > &__rhs)
bitset< _Nb > & _Unchecked_flip(size_t __pos)
bitset(const string &__s, size_t __pos=0, size_t __n=(size_t) -1)
bool operator==(const bitset< _Nb > &__rhs) const
bitset< _Nb > & operator&=(const bitset< _Nb > &__rhs)
reference operator[](size_t __pos)
bool test(size_t __pos) const
bool operator[](size_t __pos) const
bool _Unchecked_test(size_t __pos) const
bitset< _Nb > & operator<<=(size_t __pos)
#define _STLP_TEMPLATE_NULL
#define _STLP_MOVE_TO_STD_NAMESPACE
#define __STATIC_CAST(__x, __y)
#define _STLP_CLASS_DECLSPEC
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void _M_do_left_shift(size_t __shift)
unsigned long _M_do_to_ulong() const
_Base_bitset< 1UL > _Self
static size_t _STLP_CALL _S_whichbyte(size_t __pos)
size_t _M_do_count() const
_WordT _M_getword(size_t) const
static _WordT _STLP_CALL _S_maskbit(size_t __pos)
void _M_do_or(const _Self &__x)
void _M_do_right_shift(size_t __shift)
_WordT & _M_getword(size_t)
static size_t _STLP_CALL _S_whichword(size_t __pos)
void _M_do_and(const _Self &__x)
static size_t _STLP_CALL _S_whichbit(size_t __pos)
void _M_do_xor(const _Self &__x)
_Base_bitset(unsigned long __val)
bool _M_is_equal(const _Self &__x) const
void _M_do_or(const _Base_bitset< _Nw > &__x)
size_t _M_do_count() const
void _M_do_left_shift(size_t __shift)
static size_t _STLP_CALL _S_whichbyte(size_t __pos)
size_t _M_do_find_next(size_t __prev, size_t __not_found) const
static _WordT _STLP_CALL _S_maskbit(size_t __pos)
void _M_do_xor(const _Base_bitset< _Nw > &__x)
_Base_bitset(unsigned long __val)
void _M_do_right_shift(size_t __shift)
unsigned long _M_do_to_ulong() const
_WordT & _M_getword(size_t __pos)
void _M_do_and(const _Base_bitset< _Nw > &__x)
size_t _M_do_find_first(size_t __not_found) const
_WordT _M_getword(size_t __pos) const
bool _M_is_equal(const _Base_bitset< _Nw > &__x) const
static size_t _STLP_CALL _S_whichword(size_t __pos)
static size_t _STLP_CALL _S_whichbit(size_t __pos)
static void _STLP_CALL _M_do_sanitize(unsigned long)
static void _STLP_CALL _M_do_sanitize(unsigned long &__val)
reference(_Bitset &__b, size_t __pos)
_STLP_PRIV _Base_bitset< _Words > _Bitset_base
reference & operator=(bool __x)
reference & operator=(const reference &__j)