@@ -3851,46 +3851,52 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Tra
38513851 __lhs.swap (__rhs);
38523852}
38533853
3854- _LIBCPP_EXPORTED_FROM_ABI int stoi (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3855- _LIBCPP_EXPORTED_FROM_ABI long stol (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3856- _LIBCPP_EXPORTED_FROM_ABI unsigned long stoul (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3857- _LIBCPP_EXPORTED_FROM_ABI long long stoll (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3858- _LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3859-
3860- _LIBCPP_EXPORTED_FROM_ABI float stof (const string& __str, size_t * __idx = nullptr );
3861- _LIBCPP_EXPORTED_FROM_ABI double stod (const string& __str, size_t * __idx = nullptr );
3862- _LIBCPP_EXPORTED_FROM_ABI long double stold (const string& __str, size_t * __idx = nullptr );
3863-
3864- _LIBCPP_EXPORTED_FROM_ABI string to_string (int __val);
3865- _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned __val);
3866- _LIBCPP_EXPORTED_FROM_ABI string to_string (long __val);
3867- _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned long __val);
3868- _LIBCPP_EXPORTED_FROM_ABI string to_string (long long __val);
3869- _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned long long __val);
3870- _LIBCPP_EXPORTED_FROM_ABI string to_string (float __val);
3871- _LIBCPP_EXPORTED_FROM_ABI string to_string (double __val);
3872- _LIBCPP_EXPORTED_FROM_ABI string to_string (long double __val);
3854+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI int stoi (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3855+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long
3856+ stoul (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3857+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long stol (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3858+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long long
3859+ stoll (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3860+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long long
3861+ stoull (const string& __str, size_t * __idx = nullptr , int __base = 10 );
3862+
3863+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI float stof (const string& __str, size_t * __idx = nullptr );
3864+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI double stod (const string& __str, size_t * __idx = nullptr );
3865+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long double stold (const string& __str, size_t * __idx = nullptr );
3866+
3867+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (int __val);
3868+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned __val);
3869+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (long __val);
3870+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned long __val);
3871+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (long long __val);
3872+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (unsigned long long __val);
3873+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (float __val);
3874+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (double __val);
3875+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI string to_string (long double __val);
38733876
38743877# if _LIBCPP_HAS_WIDE_CHARACTERS
3875- _LIBCPP_EXPORTED_FROM_ABI int stoi (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3876- _LIBCPP_EXPORTED_FROM_ABI long stol (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3877- _LIBCPP_EXPORTED_FROM_ABI unsigned long stoul (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3878- _LIBCPP_EXPORTED_FROM_ABI long long stoll (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3879- _LIBCPP_EXPORTED_FROM_ABI unsigned long long stoull (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3880-
3881- _LIBCPP_EXPORTED_FROM_ABI float stof (const wstring& __str, size_t * __idx = nullptr );
3882- _LIBCPP_EXPORTED_FROM_ABI double stod (const wstring& __str, size_t * __idx = nullptr );
3883- _LIBCPP_EXPORTED_FROM_ABI long double stold (const wstring& __str, size_t * __idx = nullptr );
3884-
3885- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (int __val);
3886- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned __val);
3887- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long __val);
3888- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned long __val);
3889- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long long __val);
3890- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned long long __val);
3891- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (float __val);
3892- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (double __val);
3893- _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long double __val);
3878+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI int stoi (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3879+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long stol (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3880+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long
3881+ stoul (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3882+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long long
3883+ stoll (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3884+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI unsigned long long
3885+ stoull (const wstring& __str, size_t * __idx = nullptr , int __base = 10 );
3886+
3887+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI float stof (const wstring& __str, size_t * __idx = nullptr );
3888+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI double stod (const wstring& __str, size_t * __idx = nullptr );
3889+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long double stold (const wstring& __str, size_t * __idx = nullptr );
3890+
3891+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (int __val);
3892+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned __val);
3893+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long __val);
3894+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned long __val);
3895+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long long __val);
3896+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (unsigned long long __val);
3897+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (float __val);
3898+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (double __val);
3899+ [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI wstring to_wstring (long double __val);
38943900# endif // _LIBCPP_HAS_WIDE_CHARACTERS
38953901
38963902template <class _CharT , class _Traits , class _Allocator >
@@ -3899,7 +3905,7 @@ _LIBCPP_TEMPLATE_DATA_VIS const typename basic_string<_CharT, _Traits, _Allocato
38993905
39003906template <class _CharT , class _Allocator >
39013907struct __string_hash : public __unary_function <basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t > {
3902- _LIBCPP_HIDE_FROM_ABI size_t
3908+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t
39033909 operator ()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT {
39043910 return std::__do_string_hash (__val.data (), __val.data () + __val.size ());
39053911 }
@@ -3970,30 +3976,31 @@ erase_if(basic_string<_CharT, _Traits, _Allocator>& __str, _Predicate __pred) {
39703976// Literal suffixes for basic_string [basic.string.literals]
39713977inline namespace literals {
39723978inline namespace string_literals {
3973- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char >
3979+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char >
39743980operator " " s(const char * __str, size_t __len) {
39753981 return basic_string<char >(__str, __len);
39763982}
39773983
39783984# if _LIBCPP_HAS_WIDE_CHARACTERS
3979- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string< wchar_t >
3980- operator " " s(const wchar_t * __str, size_t __len) {
3985+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3986+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string< wchar_t > operator " " s(const wchar_t * __str, size_t __len) {
39813987 return basic_string<wchar_t >(__str, __len);
39823988}
39833989# endif
39843990
39853991# if _LIBCPP_HAS_CHAR8_T
3986- inline _LIBCPP_HIDE_FROM_ABI constexpr basic_string<char8_t > operator " " s(const char8_t * __str, size_t __len) {
3992+ [[__nodiscard__]] inline
3993+ _LIBCPP_HIDE_FROM_ABI constexpr basic_string<char8_t > operator " " s(const char8_t * __str, size_t __len) {
39873994 return basic_string<char8_t >(__str, __len);
39883995}
39893996# endif
39903997
3991- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string< char16_t >
3992- operator " " s(const char16_t * __str, size_t __len) {
3998+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI
3999+ _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string< char16_t > operator " " s(const char16_t * __str, size_t __len) {
39934000 return basic_string<char16_t >(__str, __len);
39944001}
39954002
3996- inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char32_t >
4003+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<char32_t >
39974004operator " " s(const char32_t * __str, size_t __len) {
39984005 return basic_string<char32_t >(__str, __len);
39994006}
0 commit comments