📄 rope.html
字号:
void replace(const iterator& p, iterator f, iterator l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, size_t n, const rope& x)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, size_t n, const charT* s, size_t n)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, size_t n, charT c)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, size_t n, const charT* s)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><pre>void replace(size_t i, size_t n, const charT* f, const charT* l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><pre>void replace(size_t i, size_t n, const const_iterator& f, const const_iterator& l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><pre>void replace(size_t i, size_t n, const iterator& f, const iterator& l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, charT c)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, const rope& x)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, const charT* s)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, const charT* s, size_t n)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void replace(size_t i, const charT* f, const charT* l)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><pre>void replace(size_t i, const const_iterator& f, const const_iterator& l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><pre>void replace(size_t i, const iterator& f, const iterator& l)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope substr(iterator f) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope substr(const_iterator f) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope substr(iterator f, iterator l) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope substr(const_iterator f, const_iterator l) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope substr(size_t i, size_t n = 1) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void copy(charT* buf) const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Copies a rope into an array of <tt>charT</tt>.</TD></TR><TR><TD VAlign=top><pre>size_type copy(size_type pos, size_type n, charT* buf)</pre></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Copies a rope into an array of <tt>charT</tt>.</TD></TR><TR><TD VAlign=top><tt>const charT* c_str() const</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>void delete_c_str()</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>See below.</TD></TR><TR><TD VAlign=top><tt>rope operator+(const rope& L, const rope&R)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Concatenates <tt>L</tt> and <tt>R</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>rope& operator+=(rope& L, const rope& R)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Appends <tt>R</tt> to <tt>L</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>rope operator+(const rope& L, const charT* s)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Concatenates <tt>L</tt> and <tt>s</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>rope& operator+=(rope& L, const charT* s)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Appends <tt>s</tt> to <tt>L</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>rope operator+(const rope& L, charT c)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Concatenates <tt>L</tt> and <tt>c</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>rope& operator+=(rope& L, charT c)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Appends <tt>c</tt> to <tt>L</tt>. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>bool operator<(const rope&, const rope&)</tt></TD><TD VAlign=top> <A href="ForwardContainer.html">Forward Container</A></TD><TD VAlign=top>Lexicographical comparison. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>bool operator==(const rope&, const rope*)</tt></TD><TD VAlign=top> <A href="ForwardContainer.html">Forward Container</A></TD><TD VAlign=top>Tests two <tt>rope</tt>s for equality. This is a global function, not a member function.</TD></TR><TR><TD VAlign=top><tt>ostream& operator<<(ostream& os, rope x)</tt></TD><TD VAlign=top><tt>rope</tt></TD><TD VAlign=top>Outputs <tt>x</tt> to the stream <tt>os</tt>. This is a global function, not a member function.</TD></tr></table><h3>New members</h3>These members are not defined in the <A href="RandomAccessContainer.html">Random Access Container</A> requirements, but are specific to <tt>rope</tt>:<Table border><TR><TH>Function</TH><TH>Description</TH></TR><TR><TD VAlign=top><tt>rope(const charT* s)</tt></TD><TD VAlign=top>Constructs a <tt>rope</tt> from a C string. The rope consists of the sequence of characters starting with <tt>*s</tt> up to, but not including, the first null character.</TD></TR><TR><TD VAlign=top><tt>rope(const charT* s, size_t n)</tt></TD><TD VAlign=top>Constructs a <tt>rope</tt> from an array of <tt>charT</tt>. The rope consists of the characters in the range <tt>[s, s + n)</tt>. Note that this range is permitted to contain embedded null characters.</TD></TR><TR><TD VAlign=top><tt>rope(charT c)</tt></TD><TD VAlign=top>Constructs a rope consisting of the single character <tt>c</tt>.</TD></TR><TR><TD VAlign=top><tt>rope(<A href="char_producer.html">char_producer</A><charT>* cp, size_t n, bool destroy)</tt></TD><TD VAlign=top>Constructs a rope of size <tt>n</tt>, whose characters are computed as needed by <tt>cp</tt>. The object <tt>*cp</tt> must be valid as long as any reference to the resulting <tt>rope</tt>, or a <tt>rope</tt> derived from it, may be used. If <tt>destroy</tt> is <tt>true</tt>, then <tt>delete cp</tt> will be executed automatically once <tt>cp</tt> is no longer needed. Typically <tt>destroy</tt> will be <tt>true</tt> unless <tt>cp</tt> is a pointer to statically allocated storage. It is rarely safe to allocate <tt>*cp</tt> on the stack.</TD></TR><TR><TD VAlign=top><tt>size_type length() const</tt></TD><TD VAlign=top>Synonym for <tt>size</tt></TD></TR><TR><TD VAlign=top><tt>iterator mutable_begin()</tt></TD><TD VAlign=top>Returns an <tt>iterator</tt> pointing to the beginning of the <tt>rope</tt>. This member function exists because mutable <tt>rope</tt> iterators are much more expensive than constant <tt>rope</tt> iterators.</TD></TR><TR><TD VAlign=top><tt>iterator mutable_end()</tt></TD><TD VAlign=top>Returns an <tt>iterator</tt> pointing to the end of the <tt>rope</tt>. This member function exists because mutable <tt>rope</tt> iterators are much more expensive than constant <tt>rope</tt> iterators.</TD></TR><TR><TD VAlign=top><tt>iterator mutable_rbegin()</tt></TD><TD VAlign=top>Returns a <tt>reverse_iterator</tt> pointing to the beginning of the reversed <tt>rope</tt>. This member function exists because mutable <tt>rope</tt> iterators are much more expensive than constant <tt>rope</tt> iterators.</TD></TR><TR><TD VAlign=top><tt>iterator mutable_rend()</tt></TD><TD VAlign=top>Returns a <tt>reverse_iterator</tt> pointing to the end of the reversed <tt>rope</tt>. This member function exists because mutable <tt>rope</tt> iterators are much more expensive than constant <tt>rope</tt> iterators.</TD></TR><TR><TD VAlign=top><tt>reference mutable_reference_at(size_type n)</tt></TD><TD VAlign=top>Returns a <tt>reference</tt> to the <tt>n</tt>th element. This member function exists because mutable references to <tt>rope</tt> elements have fairly high overhead.</TD></TR><TR><TD VAlign=top><tt>int compare(const rope& x)</tt></TD><TD VAlign=top>Three-way comparison, much like the function <tt>strcmp</tt> from the standard C library. Returns a negative number if <tt>*this</tt> is lexicographically less than <tt>x</tt>, a positive number if <tt>*this</tt> is lexicographically greater than <tt>x</tt>, and zero if neither <tt>rope</tt> is lexicographically less than the other.</TD></TR><TR><TD VAlign=top><tt>iterator insert(const iterator& p, const rope& x)</tt></TD><TD VAlign=top>Inserts the contents of the <tt>rope</tt> <tt>x</tt> immediately before the position <tt>p</tt>.</TD></TR><TR><TD VAlign=top><tt>iterator insert(const iterator& p, const charT* s)</tt></TD><TD VAlign=top>Inserts a C string immediately before the position <tt>p</tt>. The elements that are inserted are the sequence of characters starting with <tt>*s</tt> and up to, but not including, the first null character.</TD></TR><TR><TD VAlign=top><tt>iterator insert(const iterator& p, const charT* s, size_t n)</tt></TD><TD VAlign=top>Inserts an array of <tt>charT</tt>. The elements that are inserted are the range <tt>[s, s + n)</tt>. Note that this range is permitted to contain embedded null characters.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i, const rope& x)</tt></TD><TD VAlign=top>Inserts the contents of the <tt>rope</tt> x immediately before the <tt>i</tt>th element.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i, size_t n, charT c)</tt></TD><TD VAlign=top>Inserts <tt>n</tt> copies of <tt>c</tt> immediately before the <tt>i</tt>th element.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i, const charT* s)</tt></TD><TD VAlign=top>Inserts a C string immediately before the <tt>i</tt>th element. The elements that are inserted are the sequence of characters starting with <tt>*s</tt> and up to, but not including, the first null character.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i, const charT* s, size_t n)</tt></TD><TD VAlign=top>Inserts an array of <tt>charT</tt> immediately before the <tt>i</tt>th element. The elements that are inserted are the range <tt>[s, s + n)</tt>. Note that this range is permitted to contain embedded null characters.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i, charT c)</tt></TD><TD VAlign=top>Inserts the character <tt>c</tt> immediately before the <tt>i</tt>th element.</TD></TR><TR><TD VAlign=top><tt>void insert(size_t i)</tt></TD><TD VAlign=top>Inserts the character <tt>charT()</tt> immediately before the <tt>i</tt>th element.</TD></TR><TR><TD VAlign=top>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -