bitset (232924) | bitset (241900) |
---|---|
1// -*- C++ -*- 2//===---------------------------- bitset ----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 134 unchanged lines hidden (view full) --- 143}; 144 145template <size_t _N_words, size_t _Size> 146class __bitset 147{ 148public: 149 typedef ptrdiff_t difference_type; 150 typedef size_t size_type; | 1// -*- C++ -*- 2//===---------------------------- bitset ----------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// --- 134 unchanged lines hidden (view full) --- 143}; 144 145template <size_t _N_words, size_t _Size> 146class __bitset 147{ 148public: 149 typedef ptrdiff_t difference_type; 150 typedef size_t size_type; |
151 typedef size_type __storage_type; |
|
151protected: 152 typedef __bitset __self; | 152protected: 153 typedef __bitset __self; |
153 typedef size_type __storage_type; | |
154 typedef __storage_type* __storage_pointer; 155 typedef const __storage_type* __const_storage_pointer; 156 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 157 158 friend class __bit_reference<__bitset>; 159 friend class __bit_const_reference<__bitset>; 160 friend class __bit_iterator<__bitset, false>; 161 friend class __bit_iterator<__bitset, true>; | 154 typedef __storage_type* __storage_pointer; 155 typedef const __storage_type* __const_storage_pointer; 156 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 157 158 friend class __bit_reference<__bitset>; 159 friend class __bit_const_reference<__bitset>; 160 friend class __bit_iterator<__bitset, false>; 161 friend class __bit_iterator<__bitset, true>; |
162 friend class __bit_array<__bitset>; | 162 friend struct __bit_array<__bitset>; |
163 164 __storage_type __first_[_N_words]; 165 166 typedef __bit_reference<__bitset> reference; 167 typedef __bit_const_reference<__bitset> const_reference; 168 typedef __bit_iterator<__bitset, false> iterator; 169 typedef __bit_iterator<__bitset, true> const_iterator; 170 | 163 164 __storage_type __first_[_N_words]; 165 166 typedef __bit_reference<__bitset> reference; 167 typedef __bit_const_reference<__bitset> const_reference; 168 typedef __bit_iterator<__bitset, false> iterator; 169 typedef __bit_iterator<__bitset, true> const_iterator; 170 |
171 __bitset() _NOEXCEPT; 172 explicit __bitset(unsigned long long __v) _NOEXCEPT; | 171 _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT; 172 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT; |
173 174 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT 175 {return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);} | 173 174 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT 175 {return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);} |
176 _LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT | 176 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT |
177 {return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);} 178 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT 179 {return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 180 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT 181 {return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 182 183 void operator&=(const __bitset& __v) _NOEXCEPT; 184 void operator|=(const __bitset& __v) _NOEXCEPT; --- 4 unchanged lines hidden (view full) --- 189 {return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());} 190 _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const 191 {return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());} 192 193 bool all() const _NOEXCEPT; 194 bool any() const _NOEXCEPT; 195 size_t __hash_code() const _NOEXCEPT; 196private: | 177 {return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);} 178 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT 179 {return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 180 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT 181 {return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 182 183 void operator&=(const __bitset& __v) _NOEXCEPT; 184 void operator|=(const __bitset& __v) _NOEXCEPT; --- 4 unchanged lines hidden (view full) --- 189 {return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());} 190 _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const 191 {return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());} 192 193 bool all() const _NOEXCEPT; 194 bool any() const _NOEXCEPT; 195 size_t __hash_code() const _NOEXCEPT; 196private: |
197#ifdef _LIBCPP_HAS_NO_CONSTEXPR |
|
197 void __init(unsigned long long __v, false_type) _NOEXCEPT; 198 void __init(unsigned long long __v, true_type) _NOEXCEPT; | 198 void __init(unsigned long long __v, false_type) _NOEXCEPT; 199 void __init(unsigned long long __v, true_type) _NOEXCEPT; |
200#endif // _LIBCPP_HAS_NO_CONSTEXPR |
|
199 unsigned long to_ulong(false_type) const; 200 unsigned long to_ulong(true_type) const; 201 unsigned long long to_ullong(false_type) const; 202 unsigned long long to_ullong(true_type) const; 203 unsigned long long to_ullong(true_type, false_type) const; 204 unsigned long long to_ullong(true_type, true_type) const; 205}; 206 207template <size_t _N_words, size_t _Size> 208inline _LIBCPP_INLINE_VISIBILITY | 201 unsigned long to_ulong(false_type) const; 202 unsigned long to_ulong(true_type) const; 203 unsigned long long to_ullong(false_type) const; 204 unsigned long long to_ullong(true_type) const; 205 unsigned long long to_ullong(true_type, false_type) const; 206 unsigned long long to_ullong(true_type, true_type) const; 207}; 208 209template <size_t _N_words, size_t _Size> 210inline _LIBCPP_INLINE_VISIBILITY |
211_LIBCPP_CONSTEXPR |
|
209__bitset<_N_words, _Size>::__bitset() _NOEXCEPT | 212__bitset<_N_words, _Size>::__bitset() _NOEXCEPT |
213#ifndef _LIBCPP_HAS_NO_CONSTEXPR 214 : __first_{0} 215#endif |
|
210{ | 216{ |
217#ifdef _LIBCPP_HAS_NO_CONSTEXPR |
|
211 _VSTD::fill_n(__first_, _N_words, __storage_type(0)); | 218 _VSTD::fill_n(__first_, _N_words, __storage_type(0)); |
219#endif |
|
212} 213 | 220} 221 |
222#ifdef _LIBCPP_HAS_NO_CONSTEXPR 223 |
|
214template <size_t _N_words, size_t _Size> 215void 216__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT 217{ 218 __storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)]; 219 for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word) 220 __t[__i] = static_cast<__storage_type>(__v); 221 _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_); --- 5 unchanged lines hidden (view full) --- 227inline _LIBCPP_INLINE_VISIBILITY 228void 229__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT 230{ 231 __first_[0] = __v; 232 _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0)); 233} 234 | 224template <size_t _N_words, size_t _Size> 225void 226__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT 227{ 228 __storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)]; 229 for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word) 230 __t[__i] = static_cast<__storage_type>(__v); 231 _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_); --- 5 unchanged lines hidden (view full) --- 237inline _LIBCPP_INLINE_VISIBILITY 238void 239__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT 240{ 241 __first_[0] = __v; 242 _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0)); 243} 244 |
245#endif // _LIBCPP_HAS_NO_CONSTEXPR 246 |
|
235template <size_t _N_words, size_t _Size> 236inline _LIBCPP_INLINE_VISIBILITY | 247template <size_t _N_words, size_t _Size> 248inline _LIBCPP_INLINE_VISIBILITY |
249_LIBCPP_CONSTEXPR |
|
237__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT | 250__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT |
251#ifndef _LIBCPP_HAS_NO_CONSTEXPR 252 : __first_{__v} 253#endif |
|
238{ | 254{ |
255#ifdef _LIBCPP_HAS_NO_CONSTEXPR |
|
239 __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>()); | 256 __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>()); |
257#endif |
|
240} 241 242template <size_t _N_words, size_t _Size> 243inline _LIBCPP_INLINE_VISIBILITY 244void 245__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT 246{ 247 for (size_type __i = 0; __i < _N_words; ++__i) --- 153 unchanged lines hidden (view full) --- 401} 402 403template <size_t _Size> 404class __bitset<1, _Size> 405{ 406public: 407 typedef ptrdiff_t difference_type; 408 typedef size_t size_type; | 258} 259 260template <size_t _N_words, size_t _Size> 261inline _LIBCPP_INLINE_VISIBILITY 262void 263__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT 264{ 265 for (size_type __i = 0; __i < _N_words; ++__i) --- 153 unchanged lines hidden (view full) --- 419} 420 421template <size_t _Size> 422class __bitset<1, _Size> 423{ 424public: 425 typedef ptrdiff_t difference_type; 426 typedef size_t size_type; |
427 typedef size_type __storage_type; |
|
409protected: 410 typedef __bitset __self; | 428protected: 429 typedef __bitset __self; |
411 typedef size_type __storage_type; | |
412 typedef __storage_type* __storage_pointer; 413 typedef const __storage_type* __const_storage_pointer; 414 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 415 416 friend class __bit_reference<__bitset>; 417 friend class __bit_const_reference<__bitset>; 418 friend class __bit_iterator<__bitset, false>; 419 friend class __bit_iterator<__bitset, true>; | 430 typedef __storage_type* __storage_pointer; 431 typedef const __storage_type* __const_storage_pointer; 432 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 433 434 friend class __bit_reference<__bitset>; 435 friend class __bit_const_reference<__bitset>; 436 friend class __bit_iterator<__bitset, false>; 437 friend class __bit_iterator<__bitset, true>; |
420 friend class __bit_array<__bitset>; | 438 friend struct __bit_array<__bitset>; |
421 422 __storage_type __first_; 423 424 typedef __bit_reference<__bitset> reference; 425 typedef __bit_const_reference<__bitset> const_reference; 426 typedef __bit_iterator<__bitset, false> iterator; 427 typedef __bit_iterator<__bitset, true> const_iterator; 428 | 439 440 __storage_type __first_; 441 442 typedef __bit_reference<__bitset> reference; 443 typedef __bit_const_reference<__bitset> const_reference; 444 typedef __bit_iterator<__bitset, false> iterator; 445 typedef __bit_iterator<__bitset, true> const_iterator; 446 |
429 __bitset() _NOEXCEPT; 430 explicit __bitset(unsigned long long __v) _NOEXCEPT; | 447 _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT; 448 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT; |
431 432 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT 433 {return reference(&__first_, __storage_type(1) << __pos);} | 449 450 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT 451 {return reference(&__first_, __storage_type(1) << __pos);} |
434 _LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT | 452 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT |
435 {return const_reference(&__first_, __storage_type(1) << __pos);} 436 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT 437 {return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 438 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT 439 {return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 440 441 void operator&=(const __bitset& __v) _NOEXCEPT; 442 void operator|=(const __bitset& __v) _NOEXCEPT; --- 7 unchanged lines hidden (view full) --- 450 bool all() const _NOEXCEPT; 451 bool any() const _NOEXCEPT; 452 453 size_t __hash_code() const _NOEXCEPT; 454}; 455 456template <size_t _Size> 457inline _LIBCPP_INLINE_VISIBILITY | 453 {return const_reference(&__first_, __storage_type(1) << __pos);} 454 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT 455 {return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 456 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT 457 {return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);} 458 459 void operator&=(const __bitset& __v) _NOEXCEPT; 460 void operator|=(const __bitset& __v) _NOEXCEPT; --- 7 unchanged lines hidden (view full) --- 468 bool all() const _NOEXCEPT; 469 bool any() const _NOEXCEPT; 470 471 size_t __hash_code() const _NOEXCEPT; 472}; 473 474template <size_t _Size> 475inline _LIBCPP_INLINE_VISIBILITY |
476_LIBCPP_CONSTEXPR |
|
458__bitset<1, _Size>::__bitset() _NOEXCEPT 459 : __first_(0) 460{ 461} 462 463template <size_t _Size> 464inline _LIBCPP_INLINE_VISIBILITY | 477__bitset<1, _Size>::__bitset() _NOEXCEPT 478 : __first_(0) 479{ 480} 481 482template <size_t _Size> 483inline _LIBCPP_INLINE_VISIBILITY |
484_LIBCPP_CONSTEXPR |
|
465__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT 466 : __first_(static_cast<__storage_type>(__v)) 467{ 468} 469 470template <size_t _Size> 471inline _LIBCPP_INLINE_VISIBILITY 472void --- 71 unchanged lines hidden (view full) --- 544} 545 546template <> 547class __bitset<0, 0> 548{ 549public: 550 typedef ptrdiff_t difference_type; 551 typedef size_t size_type; | 485__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT 486 : __first_(static_cast<__storage_type>(__v)) 487{ 488} 489 490template <size_t _Size> 491inline _LIBCPP_INLINE_VISIBILITY 492void --- 71 unchanged lines hidden (view full) --- 564} 565 566template <> 567class __bitset<0, 0> 568{ 569public: 570 typedef ptrdiff_t difference_type; 571 typedef size_t size_type; |
572 typedef size_type __storage_type; |
|
552protected: 553 typedef __bitset __self; | 573protected: 574 typedef __bitset __self; |
554 typedef size_type __storage_type; | |
555 typedef __storage_type* __storage_pointer; 556 typedef const __storage_type* __const_storage_pointer; 557 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 558 559 friend class __bit_reference<__bitset>; 560 friend class __bit_const_reference<__bitset>; 561 friend class __bit_iterator<__bitset, false>; 562 friend class __bit_iterator<__bitset, true>; 563 friend struct __bit_array<__bitset>; 564 565 typedef __bit_reference<__bitset> reference; 566 typedef __bit_const_reference<__bitset> const_reference; 567 typedef __bit_iterator<__bitset, false> iterator; 568 typedef __bit_iterator<__bitset, true> const_iterator; 569 | 575 typedef __storage_type* __storage_pointer; 576 typedef const __storage_type* __const_storage_pointer; 577 static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT); 578 579 friend class __bit_reference<__bitset>; 580 friend class __bit_const_reference<__bitset>; 581 friend class __bit_iterator<__bitset, false>; 582 friend class __bit_iterator<__bitset, true>; 583 friend struct __bit_array<__bitset>; 584 585 typedef __bit_reference<__bitset> reference; 586 typedef __bit_const_reference<__bitset> const_reference; 587 typedef __bit_iterator<__bitset, false> iterator; 588 typedef __bit_iterator<__bitset, true> const_iterator; 589 |
570 __bitset() _NOEXCEPT; 571 explicit __bitset(unsigned long long) _NOEXCEPT; | 590 _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT; 591 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT; |
572 573 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT 574 {return reference(0, 1);} | 592 593 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT 594 {return reference(0, 1);} |
575 _LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const _NOEXCEPT | 595 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT |
576 {return const_reference(0, 1);} 577 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT 578 {return iterator(0, 0);} 579 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT 580 {return const_iterator(0, 0);} 581 582 _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {} 583 _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {} --- 6 unchanged lines hidden (view full) --- 590 591 _LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;} 592 _LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;} 593 594 _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;} 595}; 596 597inline _LIBCPP_INLINE_VISIBILITY | 596 {return const_reference(0, 1);} 597 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT 598 {return iterator(0, 0);} 599 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT 600 {return const_iterator(0, 0);} 601 602 _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {} 603 _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {} --- 6 unchanged lines hidden (view full) --- 610 611 _LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;} 612 _LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;} 613 614 _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;} 615}; 616 617inline _LIBCPP_INLINE_VISIBILITY |
618_LIBCPP_CONSTEXPR |
|
598__bitset<0, 0>::__bitset() _NOEXCEPT 599{ 600} 601 602inline _LIBCPP_INLINE_VISIBILITY | 619__bitset<0, 0>::__bitset() _NOEXCEPT 620{ 621} 622 623inline _LIBCPP_INLINE_VISIBILITY |
624_LIBCPP_CONSTEXPR |
|
603__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT 604{ 605} 606 | 625__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT 626{ 627} 628 |
607template | 629template <size_t _Size> class _LIBCPP_VISIBLE bitset; |
608template <size_t _Size> struct hash<bitset<_Size> >; 609 610template <size_t _Size> 611class _LIBCPP_VISIBLE bitset 612 : private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size> 613{ 614 static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1; 615 typedef __bitset<__n_words, _Size> base; 616 617public: 618 typedef typename base::reference reference; 619 typedef typename base::const_reference const_reference; 620 621 // 23.3.5.1 constructors: | 630template <size_t _Size> struct hash<bitset<_Size> >; 631 632template <size_t _Size> 633class _LIBCPP_VISIBLE bitset 634 : private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size> 635{ 636 static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1; 637 typedef __bitset<__n_words, _Size> base; 638 639public: 640 typedef typename base::reference reference; 641 typedef typename base::const_reference const_reference; 642 643 // 23.3.5.1 constructors: |
622 /*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() _NOEXCEPT {} 623 /*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) _NOEXCEPT : base(__v) {} | 644 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {} 645 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR 646 bitset(unsigned long long __v) _NOEXCEPT : base(__v) {} |
624 template<class _CharT> 625 explicit bitset(const _CharT* __str, 626 typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos, 627 _CharT __zero = _CharT('0'), _CharT __one = _CharT('1')); 628 template<class _CharT, class _Traits, class _Allocator> 629 explicit bitset(const basic_string<_CharT,_Traits,_Allocator>& __str, 630 typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos = 0, 631 typename basic_string<_CharT,_Traits,_Allocator>::size_type __n = --- 10 unchanged lines hidden (view full) --- 642 bitset& set(size_t __pos, bool __val = true); 643 bitset& reset() _NOEXCEPT; 644 bitset& reset(size_t __pos); 645 bitset operator~() const _NOEXCEPT; 646 bitset& flip() _NOEXCEPT; 647 bitset& flip(size_t __pos); 648 649 // element access: | 647 template<class _CharT> 648 explicit bitset(const _CharT* __str, 649 typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos, 650 _CharT __zero = _CharT('0'), _CharT __one = _CharT('1')); 651 template<class _CharT, class _Traits, class _Allocator> 652 explicit bitset(const basic_string<_CharT,_Traits,_Allocator>& __str, 653 typename basic_string<_CharT,_Traits,_Allocator>::size_type __pos = 0, 654 typename basic_string<_CharT,_Traits,_Allocator>::size_type __n = --- 10 unchanged lines hidden (view full) --- 665 bitset& set(size_t __pos, bool __val = true); 666 bitset& reset() _NOEXCEPT; 667 bitset& reset(size_t __pos); 668 bitset operator~() const _NOEXCEPT; 669 bitset& flip() _NOEXCEPT; 670 bitset& flip(size_t __pos); 671 672 // element access: |
650 _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_t __p) const {return base::__make_ref(__p);} | 673 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR 674 const_reference operator[](size_t __p) const {return base::__make_ref(__p);} |
651 _LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);} 652 unsigned long to_ulong() const; 653 unsigned long long to_ullong() const; 654 template <class _CharT, class _Traits, class _Allocator> 655 basic_string<_CharT, _Traits, _Allocator> to_string(_CharT __zero = _CharT('0'), 656 _CharT __one = _CharT('1')) const; 657 template <class _CharT, class _Traits> 658 basic_string<_CharT, _Traits, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'), 659 _CharT __one = _CharT('1')) const; 660 template <class _CharT> 661 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'), 662 _CharT __one = _CharT('1')) const; 663 basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0', 664 char __one = '1') const; 665 size_t count() const _NOEXCEPT; | 675 _LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);} 676 unsigned long to_ulong() const; 677 unsigned long long to_ullong() const; 678 template <class _CharT, class _Traits, class _Allocator> 679 basic_string<_CharT, _Traits, _Allocator> to_string(_CharT __zero = _CharT('0'), 680 _CharT __one = _CharT('1')) const; 681 template <class _CharT, class _Traits> 682 basic_string<_CharT, _Traits, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'), 683 _CharT __one = _CharT('1')) const; 684 template <class _CharT> 685 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'), 686 _CharT __one = _CharT('1')) const; 687 basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0', 688 char __one = '1') const; 689 size_t count() const _NOEXCEPT; |
666 /*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const _NOEXCEPT {return _Size;} | 690 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;} |
667 bool operator==(const bitset& __rhs) const _NOEXCEPT; 668 bool operator!=(const bitset& __rhs) const _NOEXCEPT; 669 bool test(size_t __pos) const; 670 bool all() const _NOEXCEPT; 671 bool any() const _NOEXCEPT; 672 _LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();} 673 bitset operator<<(size_t __pos) const _NOEXCEPT; 674 bitset operator>>(size_t __pos) const _NOEXCEPT; --- 376 unchanged lines hidden --- | 691 bool operator==(const bitset& __rhs) const _NOEXCEPT; 692 bool operator!=(const bitset& __rhs) const _NOEXCEPT; 693 bool test(size_t __pos) const; 694 bool all() const _NOEXCEPT; 695 bool any() const _NOEXCEPT; 696 _LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();} 697 bitset operator<<(size_t __pos) const _NOEXCEPT; 698 bitset operator>>(size_t __pos) const _NOEXCEPT; --- 376 unchanged lines hidden --- |