Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
string4334 linesDownload Raw Back to include
1// -*- C++ -*-2//===--------------------------- string -----------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCUDACXX_STRING11#define _LIBCUDACXX_STRING12 13/*14    string synopsis15 16namespace std17{18 19template <class stateT>20class fpos21{22private:23    stateT st;24public:25    fpos(streamoff = streamoff());26 27    operator streamoff() const;28 29    stateT state() const;30    void state(stateT);31 32    fpos& operator+=(streamoff);33    fpos  operator+ (streamoff) const;34    fpos& operator-=(streamoff);35    fpos  operator- (streamoff) const;36};37 38template <class stateT> streamoff operator-(const fpos<stateT>& x, const fpos<stateT>& y);39 40template <class stateT> bool operator==(const fpos<stateT>& x, const fpos<stateT>& y);41template <class stateT> bool operator!=(const fpos<stateT>& x, const fpos<stateT>& y);42 43template <class charT>44struct char_traits45{46    typedef charT     char_type;47    typedef ...       int_type;48    typedef streamoff off_type;49    typedef streampos pos_type;50    typedef mbstate_t state_type;51 52    static void assign(char_type& c1, const char_type& c2) noexcept;53    static constexpr bool eq(char_type c1, char_type c2) noexcept;54    static constexpr bool lt(char_type c1, char_type c2) noexcept;55 56    static int              compare(const char_type* s1, const char_type* s2, size_t n);57    static size_t           length(const char_type* s);58    static const char_type* find(const char_type* s, size_t n, const char_type& a);59    static char_type*       move(char_type* s1, const char_type* s2, size_t n);60    static char_type*       copy(char_type* s1, const char_type* s2, size_t n);61    static char_type*       assign(char_type* s, size_t n, char_type a);62 63    static constexpr int_type  not_eof(int_type c) noexcept;64    static constexpr char_type to_char_type(int_type c) noexcept;65    static constexpr int_type  to_int_type(char_type c) noexcept;66    static constexpr bool      eq_int_type(int_type c1, int_type c2) noexcept;67    static constexpr int_type  eof() noexcept;68};69 70template <> struct char_traits<char>;71template <> struct char_traits<wchar_t>;72 73template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >74class basic_string75{76public:77// types:78    typedef traits traits_type;79    typedef typename traits_type::char_type value_type;80    typedef Allocator allocator_type;81    typedef typename allocator_type::size_type size_type;82    typedef typename allocator_type::difference_type difference_type;83    typedef typename allocator_type::reference reference;84    typedef typename allocator_type::const_reference const_reference;85    typedef typename allocator_type::pointer pointer;86    typedef typename allocator_type::const_pointer const_pointer;87    typedef implementation-defined iterator;88    typedef implementation-defined const_iterator;89    typedef std::reverse_iterator<iterator> reverse_iterator;90    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;91 92    static const size_type npos = -1;93 94    basic_string()95        noexcept(is_nothrow_default_constructible<allocator_type>::value);96    explicit basic_string(const allocator_type& a);97    basic_string(const basic_string& str);98    basic_string(basic_string&& str)99        noexcept(is_nothrow_move_constructible<allocator_type>::value);100    basic_string(const basic_string& str, size_type pos,101                 const allocator_type& a = allocator_type());102    basic_string(const basic_string& str, size_type pos, size_type n,103                 const Allocator& a = Allocator());104    template<class T>105        basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17106    template <class T>107        explicit basic_string(const T& t, const Allocator& a = Allocator()); // C++17108    basic_string(const value_type* s, const allocator_type& a = allocator_type());109    basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type());110    basic_string(size_type n, value_type c, const allocator_type& a = allocator_type());111    template<class InputIterator>112        basic_string(InputIterator begin, InputIterator end,113                     const allocator_type& a = allocator_type());114    basic_string(initializer_list<value_type>, const Allocator& = Allocator());115    basic_string(const basic_string&, const Allocator&);116    basic_string(basic_string&&, const Allocator&);117 118    ~basic_string();119 120    operator basic_string_view<charT, traits>() const noexcept;121 122    basic_string& operator=(const basic_string& str);123    template <class T>124        basic_string& operator=(const T& t); // C++17125    basic_string& operator=(basic_string&& str)126        noexcept(127             allocator_type::propagate_on_container_move_assignment::value ||128             allocator_type::is_always_equal::value ); // C++17129    basic_string& operator=(const value_type* s);130    basic_string& operator=(value_type c);131    basic_string& operator=(initializer_list<value_type>);132 133    iterator       begin() noexcept;134    const_iterator begin() const noexcept;135    iterator       end() noexcept;136    const_iterator end() const noexcept;137 138    reverse_iterator       rbegin() noexcept;139    const_reverse_iterator rbegin() const noexcept;140    reverse_iterator       rend() noexcept;141    const_reverse_iterator rend() const noexcept;142 143    const_iterator         cbegin() const noexcept;144    const_iterator         cend() const noexcept;145    const_reverse_iterator crbegin() const noexcept;146    const_reverse_iterator crend() const noexcept;147 148    size_type size() const noexcept;149    size_type length() const noexcept;150    size_type max_size() const noexcept;151    size_type capacity() const noexcept;152 153    void resize(size_type n, value_type c);154    void resize(size_type n);155 156    void reserve(size_type res_arg = 0);157    void shrink_to_fit();158    void clear() noexcept;159    bool empty() const noexcept;160 161    const_reference operator[](size_type pos) const;162    reference       operator[](size_type pos);163 164    const_reference at(size_type n) const;165    reference       at(size_type n);166 167    basic_string& operator+=(const basic_string& str);168    template <class T>169        basic_string& operator+=(const T& t);              // C++17170    basic_string& operator+=(const value_type* s);171    basic_string& operator+=(value_type c);172    basic_string& operator+=(initializer_list<value_type>);173 174    basic_string& append(const basic_string& str);175    template <class T>176        basic_string& append(const T& t);                 // C++17177    basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14178    template <class T>179        basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17180    basic_string& append(const value_type* s, size_type n);181    basic_string& append(const value_type* s);182    basic_string& append(size_type n, value_type c);183    template<class InputIterator>184        basic_string& append(InputIterator first, InputIterator last);185    basic_string& append(initializer_list<value_type>);186 187    void push_back(value_type c);188    void pop_back();189    reference       front();190    const_reference front() const;191    reference       back();192    const_reference back() const;193 194    basic_string& assign(const basic_string& str);195    template <class T>196        basic_string& assign(const T& t);  // C++17197    basic_string& assign(basic_string&& str);198    basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14199    template <class T>200        basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17201    basic_string& assign(const value_type* s, size_type n);202    basic_string& assign(const value_type* s);203    basic_string& assign(size_type n, value_type c);204    template<class InputIterator>205        basic_string& assign(InputIterator first, InputIterator last);206    basic_string& assign(initializer_list<value_type>);207 208    basic_string& insert(size_type pos1, const basic_string& str);209    template <class T>210        basic_string& insert(size_type pos1, const T& t);211    basic_string& insert(size_type pos1, const basic_string& str,212                         size_type pos2, size_type n);213    template <class T>214        basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17215    basic_string& insert(size_type pos, const value_type* s, size_type n=npos); //C++14216    basic_string& insert(size_type pos, const value_type* s);217    basic_string& insert(size_type pos, size_type n, value_type c);218    iterator      insert(const_iterator p, value_type c);219    iterator      insert(const_iterator p, size_type n, value_type c);220    template<class InputIterator>221        iterator insert(const_iterator p, InputIterator first, InputIterator last);222    iterator      insert(const_iterator p, initializer_list<value_type>);223 224    basic_string& erase(size_type pos = 0, size_type n = npos);225    iterator      erase(const_iterator position);226    iterator      erase(const_iterator first, const_iterator last);227 228    basic_string& replace(size_type pos1, size_type n1, const basic_string& str);229    template <class T>230    basic_string& replace(size_type pos1, size_type n1, const T& t);  // C++17231    basic_string& replace(size_type pos1, size_type n1, const basic_string& str,232                          size_type pos2, size_type n2=npos); // C++14233    template <class T>234        basic_string& replace(size_type pos1, size_type n1, const T& t,235                              size_type pos2, size_type n); // C++17236    basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2);237    basic_string& replace(size_type pos, size_type n1, const value_type* s);238    basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c);239    basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str);240    template <class T>241        basic_string& replace(const_iterator i1, const_iterator i2, const T& t);  // C++17242    basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n);243    basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s);244    basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c);245    template<class InputIterator>246        basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2);247    basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<value_type>);248 249    size_type copy(value_type* s, size_type n, size_type pos = 0) const;250    basic_string substr(size_type pos = 0, size_type n = npos) const;251 252    void swap(basic_string& str)253        noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value ||254                 allocator_traits<allocator_type>::is_always_equal::value);  // C++17255 256    const value_type* c_str() const noexcept;257    const value_type* data() const noexcept;258          value_type* data()       noexcept;   // C++17259 260    allocator_type get_allocator() const noexcept;261 262    size_type find(const basic_string& str, size_type pos = 0) const noexcept;263    template <class T>264        size_type find(const T& t, size_type pos = 0) const;  // C++17265    size_type find(const value_type* s, size_type pos, size_type n) const noexcept;266    size_type find(const value_type* s, size_type pos = 0) const noexcept;267    size_type find(value_type c, size_type pos = 0) const noexcept;268 269    size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;270    template <class T>271        size_type rfind(const T& t, size_type pos = npos) const;  // C++17272    size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;273    size_type rfind(const value_type* s, size_type pos = npos) const noexcept;274    size_type rfind(value_type c, size_type pos = npos) const noexcept;275 276    size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;277    template <class T>278        size_type find_first_of(const T& t, size_type pos = 0) const; // C++17279    size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;280    size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;281    size_type find_first_of(value_type c, size_type pos = 0) const noexcept;282 283    size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;284    template <class T>285        size_type find_last_of(const T& t, size_type pos = npos) const noexcept;  // C++17286    size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;287    size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;288    size_type find_last_of(value_type c, size_type pos = npos) const noexcept;289 290    size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;291    template <class T>292        size_type find_first_not_of(const T& t, size_type pos = 0) const; // C++17293    size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;294    size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;295    size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;296 297    size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;298    template <class T>299        size_type find_last_not_of(const T& t, size_type pos = npos) const; // C++17300    size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;301    size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;302    size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;303 304    int compare(const basic_string& str) const noexcept;305    template <class T>306        int compare(const T& t) const noexcept;  // C++17307    int compare(size_type pos1, size_type n1, const basic_string& str) const;308    template <class T>309        int compare(size_type pos1, size_type n1, const T& t) const;  // C++17310    int compare(size_type pos1, size_type n1, const basic_string& str,311                size_type pos2, size_type n2=npos) const; // C++14312    template <class T>313        int compare(size_type pos1, size_type n1, const T& t,314                    size_type pos2, size_type n2=npos) const; // C++17315    int compare(const value_type* s) const noexcept;316    int compare(size_type pos1, size_type n1, const value_type* s) const;317    int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;318 319    bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a320    bool starts_with(charT c) const noexcept;                             // C++2a321    bool starts_with(const charT* s) const;                               // C++2a322    bool ends_with(basic_string_view<charT, traits> sv) const noexcept;   // C++2a323    bool ends_with(charT c) const noexcept;                               // C++2a324    bool ends_with(const charT* s) const;                                 // C++2a325 326    bool __invariants() const;327};328 329template<class InputIterator,330         class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>331basic_string(InputIterator, InputIterator, Allocator = Allocator())332   -> basic_string<typename iterator_traits<InputIterator>::value_type,333                  char_traits<typename iterator_traits<InputIterator>::value_type>,334                  Allocator>;   // C++17335 336template<class charT, class traits, class Allocator>337basic_string<charT, traits, Allocator>338operator+(const basic_string<charT, traits, Allocator>& lhs,339          const basic_string<charT, traits, Allocator>& rhs);340 341template<class charT, class traits, class Allocator>342basic_string<charT, traits, Allocator>343operator+(const charT* lhs , const basic_string<charT,traits,Allocator>&rhs);344 345template<class charT, class traits, class Allocator>346basic_string<charT, traits, Allocator>347operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs);348 349template<class charT, class traits, class Allocator>350basic_string<charT, traits, Allocator>351operator+(const basic_string<charT, traits, Allocator>& lhs, const charT* rhs);352 353template<class charT, class traits, class Allocator>354basic_string<charT, traits, Allocator>355operator+(const basic_string<charT, traits, Allocator>& lhs, charT rhs);356 357template<class charT, class traits, class Allocator>358bool operator==(const basic_string<charT, traits, Allocator>& lhs,359                const basic_string<charT, traits, Allocator>& rhs) noexcept;360 361template<class charT, class traits, class Allocator>362bool operator==(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;363 364template<class charT, class traits, class Allocator>365bool operator==(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) noexcept;366 367template<class charT, class traits, class Allocator>368bool operator!=(const basic_string<charT,traits,Allocator>& lhs,369                const basic_string<charT, traits, Allocator>& rhs) noexcept;370 371template<class charT, class traits, class Allocator>372bool operator!=(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;373 374template<class charT, class traits, class Allocator>375bool operator!=(const basic_string<charT, traits, Allocator>& lhs, const charT* rhs) noexcept;376 377template<class charT, class traits, class Allocator>378bool operator< (const basic_string<charT, traits, Allocator>& lhs,379                const basic_string<charT, traits, Allocator>& rhs) noexcept;380 381template<class charT, class traits, class Allocator>382bool operator< (const basic_string<charT, traits, Allocator>& lhs, const charT* rhs) noexcept;383 384template<class charT, class traits, class Allocator>385bool operator< (const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;386 387template<class charT, class traits, class Allocator>388bool operator> (const basic_string<charT, traits, Allocator>& lhs,389                const basic_string<charT, traits, Allocator>& rhs) noexcept;390 391template<class charT, class traits, class Allocator>392bool operator> (const basic_string<charT, traits, Allocator>& lhs, const charT* rhs) noexcept;393 394template<class charT, class traits, class Allocator>395bool operator> (const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;396 397template<class charT, class traits, class Allocator>398bool operator<=(const basic_string<charT, traits, Allocator>& lhs,399                const basic_string<charT, traits, Allocator>& rhs) noexcept;400 401template<class charT, class traits, class Allocator>402bool operator<=(const basic_string<charT, traits, Allocator>& lhs, const charT* rhs) noexcept;403 404template<class charT, class traits, class Allocator>405bool operator<=(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;406 407template<class charT, class traits, class Allocator>408bool operator>=(const basic_string<charT, traits, Allocator>& lhs,409                const basic_string<charT, traits, Allocator>& rhs) noexcept;410 411template<class charT, class traits, class Allocator>412bool operator>=(const basic_string<charT, traits, Allocator>& lhs, const charT* rhs) noexcept;413 414template<class charT, class traits, class Allocator>415bool operator>=(const charT* lhs, const basic_string<charT, traits, Allocator>& rhs) noexcept;416 417template<class charT, class traits, class Allocator>418void swap(basic_string<charT, traits, Allocator>& lhs,419          basic_string<charT, traits, Allocator>& rhs)420            noexcept(noexcept(lhs.swap(rhs)));421 422template<class charT, class traits, class Allocator>423basic_istream<charT, traits>&424operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);425 426template<class charT, class traits, class Allocator>427basic_ostream<charT, traits>&428operator<<(basic_ostream<charT, traits>& os, const basic_string<charT, traits, Allocator>& str);429 430template<class charT, class traits, class Allocator>431basic_istream<charT, traits>&432getline(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str,433        charT delim);434 435template<class charT, class traits, class Allocator>436basic_istream<charT, traits>&437getline(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);438 439template<class charT, class traits, class Allocator, class U>440void erase(basic_string<charT, traits, Allocator>& c, const U& value); // C++20441template<class charT, class traits, class Allocator, class Predicate>442void erase_if(basic_string<charT, traits, Allocator>& c, Predicate pred); // C++20443 444typedef basic_string<char>    string;445typedef basic_string<wchar_t> wstring;446typedef basic_string<char16_t> u16string;447typedef basic_string<char32_t> u32string;448 449int                stoi  (const string& str, size_t* idx = 0, int base = 10);450long               stol  (const string& str, size_t* idx = 0, int base = 10);451unsigned long      stoul (const string& str, size_t* idx = 0, int base = 10);452long long          stoll (const string& str, size_t* idx = 0, int base = 10);453unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);454 455float       stof (const string& str, size_t* idx = 0);456double      stod (const string& str, size_t* idx = 0);457long double stold(const string& str, size_t* idx = 0);458 459string to_string(int val);460string to_string(unsigned val);461string to_string(long val);462string to_string(unsigned long val);463string to_string(long long val);464string to_string(unsigned long long val);465string to_string(float val);466string to_string(double val);467string to_string(long double val);468 469int                stoi  (const wstring& str, size_t* idx = 0, int base = 10);470long               stol  (const wstring& str, size_t* idx = 0, int base = 10);471unsigned long      stoul (const wstring& str, size_t* idx = 0, int base = 10);472long long          stoll (const wstring& str, size_t* idx = 0, int base = 10);473unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);474 475float       stof (const wstring& str, size_t* idx = 0);476double      stod (const wstring& str, size_t* idx = 0);477long double stold(const wstring& str, size_t* idx = 0);478 479wstring to_wstring(int val);480wstring to_wstring(unsigned val);481wstring to_wstring(long val);482wstring to_wstring(unsigned long val);483wstring to_wstring(long long val);484wstring to_wstring(unsigned long long val);485wstring to_wstring(float val);486wstring to_wstring(double val);487wstring to_wstring(long double val);488 489template <> struct hash<string>;490template <> struct hash<u16string>;491template <> struct hash<u32string>;492template <> struct hash<wstring>;493 494basic_string<char>     operator "" s( const char *str,     size_t len ); // C++14495basic_string<wchar_t>  operator "" s( const wchar_t *str,  size_t len ); // C++14496basic_string<char16_t> operator "" s( const char16_t *str, size_t len ); // C++14497basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++14498 499}  // std500 501*/502 503#include <__config>504#include <string_view>505#include <iosfwd>506#include <cstring>507#include <cstdio>  // For EOF.508#include <cwchar>509#include <algorithm>510#include <iterator>511#include <utility>512#include <memory>513#include <stdexcept>514#include <type_traits>515#include <initializer_list>516#include <__functional_base>517#include <version>518#ifndef _LIBCUDACXX_HAS_NO_UNICODE_CHARS519#include <cstdint>520#endif521 522#include <__debug>523 524#include "__fwd/string.h"525 526#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)527#  pragma GCC system_header528#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)529#  pragma clang system_header530#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)531#  pragma system_header532#endif // no system header533 534_LIBCUDACXX_PUSH_MACROS535#include <__undef_macros>536 537 538_LIBCUDACXX_BEGIN_NAMESPACE_STD539 540// fpos541 542template <class _StateT>543class _LIBCUDACXX_TEMPLATE_VIS fpos544{545private:546    _StateT __st_;547    streamoff __off_;548public:549    _LIBCUDACXX_INLINE_VISIBILITY fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}550 551    _LIBCUDACXX_INLINE_VISIBILITY operator streamoff() const {return __off_;}552 553    _LIBCUDACXX_INLINE_VISIBILITY _StateT state() const {return __st_;}554    _LIBCUDACXX_INLINE_VISIBILITY void state(_StateT __st) {__st_ = __st;}555 556    _LIBCUDACXX_INLINE_VISIBILITY fpos& operator+=(streamoff __off) {__off_ += __off; return *this;}557    _LIBCUDACXX_INLINE_VISIBILITY fpos  operator+ (streamoff __off) const {fpos __t(*this); __t += __off; return __t;}558    _LIBCUDACXX_INLINE_VISIBILITY fpos& operator-=(streamoff __off) {__off_ -= __off; return *this;}559    _LIBCUDACXX_INLINE_VISIBILITY fpos  operator- (streamoff __off) const {fpos __t(*this); __t -= __off; return __t;}560};561 562template <class _StateT>563inline _LIBCUDACXX_INLINE_VISIBILITY564streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y)565    {return streamoff(__x) - streamoff(__y);}566 567template <class _StateT>568inline _LIBCUDACXX_INLINE_VISIBILITY569bool operator==(const fpos<_StateT>& __x, const fpos<_StateT>& __y)570    {return streamoff(__x) == streamoff(__y);}571 572template <class _StateT>573inline _LIBCUDACXX_INLINE_VISIBILITY574bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)575    {return streamoff(__x) != streamoff(__y);}576 577// basic_string578 579template<class _CharT, class _Traits, class _Allocator>580basic_string<_CharT, _Traits, _Allocator>581operator+(const basic_string<_CharT, _Traits, _Allocator>& __x,582          const basic_string<_CharT, _Traits, _Allocator>& __y);583 584template<class _CharT, class _Traits, class _Allocator>585basic_string<_CharT, _Traits, _Allocator>586operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);587 588template<class _CharT, class _Traits, class _Allocator>589basic_string<_CharT, _Traits, _Allocator>590operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);591 592template<class _CharT, class _Traits, class _Allocator>593inline _LIBCUDACXX_INLINE_VISIBILITY594basic_string<_CharT, _Traits, _Allocator>595operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);596 597template<class _CharT, class _Traits, class _Allocator>598basic_string<_CharT, _Traits, _Allocator>599operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);600 601_LIBCUDACXX_EXTERN_TEMPLATE(_LIBCUDACXX_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))602 603template <bool>604class _LIBCUDACXX_TEMPLATE_VIS __basic_string_common605{606protected:607    _LIBCUDACXX_NORETURN void __throw_length_error() const;608    _LIBCUDACXX_NORETURN void __throw_out_of_range() const;609};610 611template <bool __b>612void613__basic_string_common<__b>::__throw_length_error() const614{615    _CUDA_VSTD::__throw_length_error("basic_string");616}617 618template <bool __b>619void620__basic_string_common<__b>::__throw_out_of_range() const621{622    _CUDA_VSTD::__throw_out_of_range("basic_string");623}624 625_LIBCUDACXX_EXTERN_TEMPLATE(class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common<true>)626 627#ifdef _LIBCUDACXX_NO_EXCEPTIONS628template <class _Iter>629struct __libcpp_string_gets_noexcept_iterator_impl : public true_type {};630#elif defined(_LIBCUDACXX_HAS_NO_NOEXCEPT)631template <class _Iter>632struct __libcpp_string_gets_noexcept_iterator_impl : public false_type {};633#else634template <class _Iter, bool = __is_cpp17_forward_iterator<_Iter>::value>635struct __libcpp_string_gets_noexcept_iterator_impl : public _LIBCUDACXX_BOOL_CONSTANT((636    noexcept(++(declval<_Iter&>())) &&637    is_nothrow_assignable<_Iter&, _Iter>::value &&638    noexcept(declval<_Iter>() == declval<_Iter>()) &&639    noexcept(*declval<_Iter>())640)) {};641 642template <class _Iter>643struct __libcpp_string_gets_noexcept_iterator_impl<_Iter, false> : public false_type {};644#endif645 646 647template <class _Iter>648struct __libcpp_string_gets_noexcept_iterator649    : public _LIBCUDACXX_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value) {};650 651template <class _CharT, class _Traits, class _Tp>652struct __can_be_converted_to_string_view : public _LIBCUDACXX_BOOL_CONSTANT(653    ( is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&654     !is_convertible<const _Tp&, const _CharT*>::value)) {};655 656#ifdef _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT657 658template <class _CharT, size_t = sizeof(_CharT)>659struct __padding660{661    unsigned char __xx[sizeof(_CharT)-1];662};663 664template <class _CharT>665struct __padding<_CharT, 1>666{667};668 669#endif  // _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT670 671template<class _CharT, class _Traits, class _Allocator>672class _LIBCUDACXX_TEMPLATE_VIS basic_string673    : private __basic_string_common<true>674{675public:676    typedef basic_string                                 __self;677    typedef basic_string_view<_CharT, _Traits>           __self_view;678    typedef _Traits                                      traits_type;679    typedef _CharT                                       value_type;680    typedef _Allocator                                   allocator_type;681    typedef allocator_traits<allocator_type>             __alloc_traits;682    typedef typename __alloc_traits::size_type           size_type;683    typedef typename __alloc_traits::difference_type     difference_type;684    typedef value_type&                                  reference;685    typedef const value_type&                            const_reference;686    typedef typename __alloc_traits::pointer             pointer;687    typedef typename __alloc_traits::const_pointer       const_pointer;688 689    static_assert((!is_array<value_type>::value), "Character type of basic_string must not be an array");690    static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string must be standard-layout");691    static_assert(( is_trivial<value_type>::value), "Character type of basic_string must be trivial");692    static_assert(( is_same<_CharT, typename traits_type::char_type>::value),693                  "traits_type::char_type must be the same type as CharT");694    static_assert(( is_same<typename allocator_type::value_type, value_type>::value),695                  "Allocator::value_type must be same type as value_type");696 697#if defined(_LIBCUDACXX_RAW_ITERATORS)698    typedef pointer                                      iterator;699    typedef const_pointer                                const_iterator;700#else  // defined(_LIBCUDACXX_RAW_ITERATORS)701    typedef __wrap_iter<pointer>                         iterator;702    typedef __wrap_iter<const_pointer>                   const_iterator;703#endif  // defined(_LIBCUDACXX_RAW_ITERATORS)704    typedef _CUDA_VSTD::reverse_iterator<iterator>             reverse_iterator;705    typedef _CUDA_VSTD::reverse_iterator<const_iterator>       const_reverse_iterator;706 707private:708 709#ifdef _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT710 711    struct __long712    {713        pointer   __data_;714        size_type __size_;715        size_type __cap_;716    };717 718#ifdef _LIBCUDACXX_BIG_ENDIAN719    static const size_type __short_mask = 0x01;720    static const size_type __long_mask  = 0x1ul;721#else  // _LIBCUDACXX_BIG_ENDIAN722    static const size_type __short_mask = 0x80;723    static const size_type __long_mask  = ~(size_type(~0) >> 1);724#endif  // _LIBCUDACXX_BIG_ENDIAN725 726    enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?727                      (sizeof(__long) - 1)/sizeof(value_type) : 2};728 729    struct __short730    {731        value_type __data_[__min_cap];732        struct733            : __padding<value_type>734        {735            unsigned char __size_;736        };737    };738 739#else740 741    struct __long742    {743        size_type __cap_;744        size_type __size_;745        pointer   __data_;746    };747 748#ifdef _LIBCUDACXX_BIG_ENDIAN749    static const size_type __short_mask = 0x80;750    static const size_type __long_mask  = ~(size_type(~0) >> 1);751#else  // _LIBCUDACXX_BIG_ENDIAN752    static const size_type __short_mask = 0x01;753    static const size_type __long_mask  = 0x1ul;754#endif  // _LIBCUDACXX_BIG_ENDIAN755 756    enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?757                      (sizeof(__long) - 1)/sizeof(value_type) : 2};758 759    struct __short760    {761        union762        {763            unsigned char __size_;764            value_type __lx;765        };766        value_type __data_[__min_cap];767    };768 769#endif  // _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT770 771    union __ulx{__long __lx; __short __lxx;};772 773    enum {__n_words = sizeof(__ulx) / sizeof(size_type)};774 775    struct __raw776    {777        size_type __words[__n_words];778    };779 780    struct __rep781    {782        union783        {784            __long  __l;785            __short __s;786            __raw   __r;787        };788    };789 790    __compressed_pair<__rep, allocator_type> __r_;791 792public:793    static const size_type npos = static_cast<size_type>(-1);794 795    _LIBCUDACXX_INLINE_VISIBILITY basic_string()796        noexcept(is_nothrow_default_constructible<allocator_type>::value);797 798    _LIBCUDACXX_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)799#if _LIBCUDACXX_STD_VER <= 14800        noexcept(is_nothrow_copy_constructible<allocator_type>::value);801#else802        noexcept;803#endif804 805    basic_string(const basic_string& __str);806    basic_string(const basic_string& __str, const allocator_type& __a);807 808    _LIBCUDACXX_INLINE_VISIBILITY809    basic_string(basic_string&& __str)810#if _LIBCUDACXX_STD_VER <= 14811        noexcept(is_nothrow_move_constructible<allocator_type>::value);812#else813        noexcept;814#endif815 816    _LIBCUDACXX_INLINE_VISIBILITY817    basic_string(basic_string&& __str, const allocator_type& __a);818 819    template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>820    _LIBCUDACXX_INLINE_VISIBILITY821    basic_string(const _CharT* __s) {822      _LIBCUDACXX_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");823      __init(__s, traits_type::length(__s));824#   if _LIBCUDACXX_DEBUG_LEVEL >= 2825      __get_db()->__insert_c(this);826#   endif827    }828 829    template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>830        _LIBCUDACXX_INLINE_VISIBILITY831        basic_string(const _CharT* __s, const _Allocator& __a);832 833    _LIBCUDACXX_INLINE_VISIBILITY834    basic_string(const _CharT* __s, size_type __n);835    _LIBCUDACXX_INLINE_VISIBILITY836    basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);837    _LIBCUDACXX_INLINE_VISIBILITY838    basic_string(size_type __n, _CharT __c);839 840    template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>841        _LIBCUDACXX_INLINE_VISIBILITY842        basic_string(size_type __n, _CharT __c, const _Allocator& __a);843 844    basic_string(const basic_string& __str, size_type __pos, size_type __n,845                 const _Allocator& __a = _Allocator());846    _LIBCUDACXX_INLINE_VISIBILITY847    basic_string(const basic_string& __str, size_type __pos,848                 const _Allocator& __a = _Allocator());849 850    template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type>851        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS852        basic_string(const _Tp& __t, size_type __pos, size_type __n,853                              const allocator_type& __a = allocator_type());854 855    template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type>856        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS857        explicit basic_string(const _Tp& __t);858 859    template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type>860        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS861        explicit basic_string(const _Tp& __t, const allocator_type& __a);862 863    template<class _InputIterator, class = typename enable_if<__is_cpp17_input_iterator<_InputIterator>::value>::type>864        _LIBCUDACXX_INLINE_VISIBILITY865        basic_string(_InputIterator __first, _InputIterator __last);866    template<class _InputIterator, class = typename enable_if<__is_cpp17_input_iterator<_InputIterator>::value>::type>867        _LIBCUDACXX_INLINE_VISIBILITY868        basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);869 870    _LIBCUDACXX_INLINE_VISIBILITY871    basic_string(initializer_list<_CharT> __il);872    _LIBCUDACXX_INLINE_VISIBILITY873    basic_string(initializer_list<_CharT> __il, const _Allocator& __a);874 875    inline ~basic_string();876 877    _LIBCUDACXX_INLINE_VISIBILITY878    operator __self_view() const noexcept { return __self_view(data(), size()); }879 880    basic_string& operator=(const basic_string& __str);881 882    template <class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type>883    basic_string& operator=(const _Tp& __t)884        {__self_view __sv = __t; return assign(__sv);}885 886    _LIBCUDACXX_INLINE_VISIBILITY887    basic_string& operator=(basic_string&& __str)888        noexcept((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));889     _LIBCUDACXX_INLINE_VISIBILITY890    basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}891    _LIBCUDACXX_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}892    basic_string& operator=(value_type __c);893 894#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE895    _LIBCUDACXX_INLINE_VISIBILITY896    iterator begin() noexcept897        {return iterator(this, __get_pointer());}898    _LIBCUDACXX_INLINE_VISIBILITY899    const_iterator begin() const noexcept900        {return const_iterator(this, __get_pointer());}901    _LIBCUDACXX_INLINE_VISIBILITY902    iterator end() noexcept903        {return iterator(this, __get_pointer() + size());}904    _LIBCUDACXX_INLINE_VISIBILITY905    const_iterator end() const noexcept906        {return const_iterator(this, __get_pointer() + size());}907#else908    _LIBCUDACXX_INLINE_VISIBILITY909    iterator begin() noexcept910        {return iterator(__get_pointer());}911    _LIBCUDACXX_INLINE_VISIBILITY912    const_iterator begin() const noexcept913        {return const_iterator(__get_pointer());}914    _LIBCUDACXX_INLINE_VISIBILITY915    iterator end() noexcept916        {return iterator(__get_pointer() + size());}917    _LIBCUDACXX_INLINE_VISIBILITY918    const_iterator end() const noexcept919        {return const_iterator(__get_pointer() + size());}920#endif  // _LIBCUDACXX_ENABLE_DEBUG_MODE921    _LIBCUDACXX_INLINE_VISIBILITY922    reverse_iterator rbegin() noexcept923        {return reverse_iterator(end());}924    _LIBCUDACXX_INLINE_VISIBILITY925    const_reverse_iterator rbegin() const noexcept926        {return const_reverse_iterator(end());}927    _LIBCUDACXX_INLINE_VISIBILITY928    reverse_iterator rend() noexcept929        {return reverse_iterator(begin());}930    _LIBCUDACXX_INLINE_VISIBILITY931    const_reverse_iterator rend() const noexcept932        {return const_reverse_iterator(begin());}933 934    _LIBCUDACXX_INLINE_VISIBILITY935    const_iterator cbegin() const noexcept936        {return begin();}937    _LIBCUDACXX_INLINE_VISIBILITY938    const_iterator cend() const noexcept939        {return end();}940    _LIBCUDACXX_INLINE_VISIBILITY941    const_reverse_iterator crbegin() const noexcept942        {return rbegin();}943    _LIBCUDACXX_INLINE_VISIBILITY944    const_reverse_iterator crend() const noexcept945        {return rend();}946 947    _LIBCUDACXX_INLINE_VISIBILITY size_type size() const noexcept948        {return __is_long() ? __get_long_size() : __get_short_size();}949    _LIBCUDACXX_INLINE_VISIBILITY size_type length() const noexcept {return size();}950    _LIBCUDACXX_INLINE_VISIBILITY size_type max_size() const noexcept;951    _LIBCUDACXX_INLINE_VISIBILITY size_type capacity() const noexcept952        {return (__is_long() ? __get_long_cap()953                             : static_cast<size_type>(__min_cap)) - 1;}954 955    void resize(size_type __n, value_type __c);956    _LIBCUDACXX_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}957 958    void reserve(size_type __res_arg);959    _LIBCUDACXX_INLINE_VISIBILITY void __resize_default_init(size_type __n);960 961    _LIBCUDACXX_INLINE_VISIBILITY962    void reserve() noexcept {reserve(0);}963    _LIBCUDACXX_INLINE_VISIBILITY964    void shrink_to_fit() noexcept {reserve();}965    _LIBCUDACXX_INLINE_VISIBILITY966    void clear() noexcept;967    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY968    bool empty() const noexcept {return size() == 0;}969 970    _LIBCUDACXX_INLINE_VISIBILITY const_reference operator[](size_type __pos) const noexcept;971    _LIBCUDACXX_INLINE_VISIBILITY reference       operator[](size_type __pos)       noexcept;972 973    const_reference at(size_type __n) const;974    reference       at(size_type __n);975 976    _LIBCUDACXX_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}977 978    template <class _Tp>979    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS980    typename enable_if981        <982            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,983            basic_string&984        >::type985                                            operator+=(const _Tp& __t)            {__self_view __sv = __t; return append(__sv);}986    _LIBCUDACXX_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s)     {return append(__s);}987    _LIBCUDACXX_INLINE_VISIBILITY basic_string& operator+=(value_type __c)            {push_back(__c); return *this;}988    _LIBCUDACXX_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}989 990    _LIBCUDACXX_INLINE_VISIBILITY991    basic_string& append(const basic_string& __str);992 993    template <class _Tp>994    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS995    typename enable_if996        <997            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,998            basic_string&999        >::type1000                  append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); }1001    basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);1002 1003    template <class _Tp>1004    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1005    typename enable_if1006        <1007            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1008            basic_string&1009        >::type1010                  append(const _Tp& __t, size_type __pos, size_type __n=npos);1011    basic_string& append(const value_type* __s, size_type __n);1012    basic_string& append(const value_type* __s);1013    basic_string& append(size_type __n, value_type __c);1014 1015    _LIBCUDACXX_INLINE_VISIBILITY1016    void __append_default_init(size_type __n);1017 1018    template <class _ForwardIterator>1019    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1020    basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);1021    template<class _InputIterator>1022    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1023    typename enable_if1024        <1025            __is_exactly_cpp17_input_iterator<_InputIterator>::value1026                || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,1027            basic_string&1028        >::type1029    _LIBCUDACXX_INLINE_VISIBILITY1030    append(_InputIterator __first, _InputIterator __last) {1031      const basic_string __temp (__first, __last, __alloc());1032      append(__temp.data(), __temp.size());1033      return *this;1034    }1035    template<class _ForwardIterator>1036    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1037    typename enable_if1038        <1039            __is_cpp17_forward_iterator<_ForwardIterator>::value1040                && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,1041            basic_string&1042        >::type1043    _LIBCUDACXX_INLINE_VISIBILITY1044    append(_ForwardIterator __first, _ForwardIterator __last) {1045      return __append_forward_unsafe(__first, __last);1046    }1047 1048    _LIBCUDACXX_INLINE_VISIBILITY1049    basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}1050 1051    void push_back(value_type __c);1052    _LIBCUDACXX_INLINE_VISIBILITY1053    void pop_back();1054    _LIBCUDACXX_INLINE_VISIBILITY reference       front() noexcept;1055    _LIBCUDACXX_INLINE_VISIBILITY const_reference front() const noexcept;1056    _LIBCUDACXX_INLINE_VISIBILITY reference       back() noexcept;1057    _LIBCUDACXX_INLINE_VISIBILITY const_reference back() const noexcept;1058 1059    template <class _Tp>1060    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1061    typename enable_if1062        <1063            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1064            basic_string&1065        >::type1066                 assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); }1067    _LIBCUDACXX_INLINE_VISIBILITY1068    basic_string& assign(const basic_string& __str) { return *this = __str; }1069    _LIBCUDACXX_INLINE_VISIBILITY1070    basic_string& assign(basic_string&& __str)1071        noexcept((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))1072        {*this = _CUDA_VSTD::move(__str); return *this;}1073    basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);1074    template <class _Tp>1075    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1076    typename enable_if1077        <1078            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1079            basic_string&1080        >::type1081                  assign(const _Tp & __t, size_type __pos, size_type __n=npos);1082    basic_string& assign(const value_type* __s, size_type __n);1083    basic_string& assign(const value_type* __s);1084    basic_string& assign(size_type __n, value_type __c);1085    template<class _InputIterator>1086    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1087    typename enable_if1088        <1089           __is_exactly_cpp17_input_iterator<_InputIterator>::value1090                || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,1091            basic_string&1092        >::type1093        assign(_InputIterator __first, _InputIterator __last);1094    template<class _ForwardIterator>1095    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1096    typename enable_if1097        <1098            __is_cpp17_forward_iterator<_ForwardIterator>::value1099                 && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,1100            basic_string&1101        >::type1102        assign(_ForwardIterator __first, _ForwardIterator __last);1103    _LIBCUDACXX_INLINE_VISIBILITY1104    basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}1105 1106    _LIBCUDACXX_INLINE_VISIBILITY1107    basic_string& insert(size_type __pos1, const basic_string& __str);1108 1109    template <class _Tp>1110    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1111    typename enable_if1112        <1113            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1114            basic_string&1115        >::type1116                 insert(size_type __pos1, const _Tp& __t)1117    { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); }1118 1119    template <class _Tp>1120    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1121    typename enable_if1122        <1123            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1124            basic_string&1125        >::type1126                  insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);1127    basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);1128    basic_string& insert(size_type __pos, const value_type* __s, size_type __n);1129    basic_string& insert(size_type __pos, const value_type* __s);1130    basic_string& insert(size_type __pos, size_type __n, value_type __c);1131    iterator      insert(const_iterator __pos, value_type __c);1132    _LIBCUDACXX_INLINE_VISIBILITY1133    iterator      insert(const_iterator __pos, size_type __n, value_type __c);1134    template<class _InputIterator>1135    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1136    typename enable_if1137        <1138           __is_exactly_cpp17_input_iterator<_InputIterator>::value1139                || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,1140            iterator1141        >::type1142        insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);1143    template<class _ForwardIterator>1144    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1145    typename enable_if1146        <1147            __is_cpp17_forward_iterator<_ForwardIterator>::value1148                 && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,1149            iterator1150        >::type1151        insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);1152    _LIBCUDACXX_INLINE_VISIBILITY1153    iterator insert(const_iterator __pos, initializer_list<value_type> __il)1154                    {return insert(__pos, __il.begin(), __il.end());}1155 1156    basic_string& erase(size_type __pos = 0, size_type __n = npos);1157    _LIBCUDACXX_INLINE_VISIBILITY1158    iterator      erase(const_iterator __pos);1159    _LIBCUDACXX_INLINE_VISIBILITY1160    iterator      erase(const_iterator __first, const_iterator __last);1161 1162    _LIBCUDACXX_INLINE_VISIBILITY1163    basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);1164 1165    template <class _Tp>1166    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1167    typename enable_if1168        <1169            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1170            basic_string&1171        >::type1172                  replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); }1173    basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);1174    template <class _Tp>1175    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1176    typename enable_if1177        <1178            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1179            basic_string&1180        >::type1181                  replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);1182    basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);1183    basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);1184    basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);1185    _LIBCUDACXX_INLINE_VISIBILITY1186    basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);1187 1188    template <class _Tp>1189    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1190    typename enable_if1191        <1192            __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,1193            basic_string&1194        >::type1195                  replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); }1196 1197    _LIBCUDACXX_INLINE_VISIBILITY1198    basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);1199    _LIBCUDACXX_INLINE_VISIBILITY1200    basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);

Showing the first 1,200 of 4334 lines. Download the file for the rest.

codekingpro/portable-devtools · Team Ai