Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/c++/13/string
$ cat -n /usr/include/c++/13/string 1 // Components for manipulating sequences of characters -*- C++ -*- 2 3 // Copyright (C) 1997-2023 Free Software Foundation, Inc. 4 // 5 // This file is part of the GNU ISO C++ Library. This library is free 6 // software; you can redistribute it and/or modify it under the 7 // terms of the GNU General Public License as published by the 8 // Free Software Foundation; either version 3, or (at your option) 9 // any later version. 10 11 // This library is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 16 // Under Section 7 of GPL version 3, you are granted additional 17 // permissions described in the GCC Runtime Library Exception, version 18 // 3.1, as published by the Free Software Foundation. 19 20 // You should have received a copy of the GNU General Public License and 21 // a copy of the GCC Runtime Library Exception along with this program; 22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23 //
. 24 25 /** @file include/string 26 * This is a Standard C++ Library header. 27 */ 28 29 // 30 // ISO C++ 14882: 21 Strings library 31 // 32 33 #ifndef _GLIBCXX_STRING 34 #define _GLIBCXX_STRING 1 35 36 #pragma GCC system_header 37 38 #include
// containers 39 40 #include
41 #include
42 #include
43 #include
44 #include
45 #include
// For operators >>, <<, and getline. 46 #include
47 #include
48 #include
49 #include
// For less 50 #include
51 #include
52 #include
53 #include
54 #include
55 #include
56 57 #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI 58 #include
59 namespace std _GLIBCXX_VISIBILITY(default) 60 { 61 _GLIBCXX_BEGIN_NAMESPACE_VERSION 62 namespace pmr { 63 template
> 64 using basic_string = std::basic_string<_CharT, _Traits, 65 polymorphic_allocator<_CharT>>; 66 using string = basic_string
; 67 #ifdef _GLIBCXX_USE_CHAR8_T 68 using u8string = basic_string
; 69 #endif 70 using u16string = basic_string
; 71 using u32string = basic_string
; 72 using wstring = basic_string
; 73 } // namespace pmr 74 _GLIBCXX_END_NAMESPACE_VERSION 75 } // namespace std 76 #endif // C++17 77 78 #if __cplusplus > 201703L 79 namespace std _GLIBCXX_VISIBILITY(default) 80 { 81 _GLIBCXX_BEGIN_NAMESPACE_VERSION 82 83 #define __cpp_lib_erase_if 202002L 84 85 template
87 _GLIBCXX20_CONSTEXPR 88 inline typename basic_string<_CharT, _Traits, _Alloc>::size_type 89 erase_if(basic_string<_CharT, _Traits, _Alloc>& __cont, _Predicate __pred) 90 { 91 using namespace __gnu_cxx; 92 const auto __osz = __cont.size(); 93 const auto __end = __cont.end(); 94 auto __removed = std::__remove_if(__cont.begin(), __end, 95 __ops::__pred_iter(std::ref(__pred))); 96 __cont.erase(__removed, __end); 97 return __osz - __cont.size(); 98 } 99 100 template
101 _GLIBCXX20_CONSTEXPR 102 inline typename basic_string<_CharT, _Traits, _Alloc>::size_type 103 erase(basic_string<_CharT, _Traits, _Alloc>& __cont, const _Up& __value) 104 { 105 using namespace __gnu_cxx; 106 const auto __osz = __cont.size(); 107 const auto __end = __cont.end(); 108 auto __removed = std::__remove_if(__cont.begin(), __end, 109 __ops::__iter_equals_val(__value)); 110 __cont.erase(__removed, __end); 111 return __osz - __cont.size(); 112 } 113 _GLIBCXX_END_NAMESPACE_VERSION 114 } // namespace std 115 #endif // C++20 116 117 #endif /* _GLIBCXX_STRING */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™