@@ -675,53 +675,62 @@ public:
675675 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& set (size_t __pos, bool __val = true );
676676 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset () _NOEXCEPT;
677677 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& reset (size_t __pos);
678- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator ~() const _NOEXCEPT;
678+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator ~() const _NOEXCEPT;
679679 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip () _NOEXCEPT;
680680 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset& flip (size_t __pos);
681681
682682 // element access:
683683# ifdef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
684- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator [](size_t __p) const {
684+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator [](size_t __p) const {
685685 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS (__p < _Size, " bitset::operator[] index out of bounds" );
686686 return __base::__make_ref (__p);
687687 }
688688# else
689- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __const_reference operator [](size_t __p) const {
689+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __const_reference operator [](size_t __p) const {
690690 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS (__p < _Size, " bitset::operator[] index out of bounds" );
691691 return __base::__make_ref (__p);
692692 }
693693# endif
694- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator [](size_t __p) {
694+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 reference operator [](size_t __p) {
695695 _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS (__p < _Size, " bitset::operator[] index out of bounds" );
696696 return __base::__make_ref (__p);
697697 }
698- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong () const { return __base::to_ulong (); }
699- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong () const {
698+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long to_ulong () const {
699+ return __base::to_ulong ();
700+ }
701+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long to_ullong () const {
700702 return __base::to_ullong ();
701703 }
702704 template <class _CharT , class _Traits , class _Allocator >
703- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, _Allocator>
705+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, _Allocator>
704706 to_string (_CharT __zero = _CharT(' 0' ), _CharT __one = _CharT(' 1' )) const ;
705707 template <class _CharT , class _Traits >
706- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, allocator<_CharT> >
708+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
709+ _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, _Traits, allocator<_CharT> >
707710 to_string (_CharT __zero = _CharT(' 0' ), _CharT __one = _CharT(' 1' )) const ;
708711 template <class _CharT >
709- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> >
712+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
713+ _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> >
710714 to_string (_CharT __zero = _CharT(' 0' ), _CharT __one = _CharT(' 1' )) const ;
711- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<char , char_traits<char >, allocator<char > >
715+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI
716+ _LIBCPP_CONSTEXPR_SINCE_CXX23 basic_string<char , char_traits<char >, allocator<char > >
712717 to_string (char __zero = ' 0' , char __one = ' 1' ) const ;
713- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t count () const _NOEXCEPT;
714- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size () const _NOEXCEPT { return _Size; }
718+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 size_t count () const _NOEXCEPT;
719+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR size_t size () const _NOEXCEPT { return _Size; }
715720 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator ==(const bitset& __rhs) const _NOEXCEPT;
716721# if _LIBCPP_STD_VER <= 17
717722 _LIBCPP_HIDE_FROM_ABI bool operator !=(const bitset& __rhs) const _NOEXCEPT;
718723# endif
719- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test (size_t __pos) const ;
720- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all () const _NOEXCEPT { return __base::all (); }
721- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any () const _NOEXCEPT { return __base::any (); }
722- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none () const _NOEXCEPT { return !any (); }
723- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator <<(size_t __pos) const _NOEXCEPT;
724- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator >>(size_t __pos) const _NOEXCEPT;
724+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool test (size_t __pos) const ;
725+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool all () const _NOEXCEPT {
726+ return __base::all ();
727+ }
728+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool any () const _NOEXCEPT {
729+ return __base::any ();
730+ }
731+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool none () const _NOEXCEPT { return !any (); }
732+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator <<(size_t __pos) const _NOEXCEPT;
733+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset operator >>(size_t __pos) const _NOEXCEPT;
725734
726735private:
727736 template <class _CharT , class _Traits >
@@ -919,23 +928,23 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT {
919928}
920929
921930template <size_t _Size>
922- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
931+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
923932operator &(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
924933 bitset<_Size> __r = __x;
925934 __r &= __y;
926935 return __r;
927936}
928937
929938template <size_t _Size>
930- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
939+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
931940operator |(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
932941 bitset<_Size> __r = __x;
933942 __r |= __y;
934943 return __r;
935944}
936945
937946template <size_t _Size>
938- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
947+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bitset<_Size>
939948operator ^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
940949 bitset<_Size> __r = __x;
941950 __r ^= __y;
@@ -944,7 +953,9 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT {
944953
945954template <size_t _Size>
946955struct hash <bitset<_Size> > : public __unary_function<bitset<_Size>, size_t > {
947- _LIBCPP_HIDE_FROM_ABI size_t operator ()(const bitset<_Size>& __bs) const _NOEXCEPT { return __bs.__hash_code (); }
956+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t operator ()(const bitset<_Size>& __bs) const _NOEXCEPT {
957+ return __bs.__hash_code ();
958+ }
948959};
949960
950961template <class _CharT , class _Traits , size_t _Size>
0 commit comments