Standard Template Library Programmer's Guide
Здесь есть возможность читать онлайн «Standard Template Library Programmer's Guide» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: Программирование, Справочники, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.
- Название:Standard Template Library Programmer's Guide
- Автор:
- Жанр:
- Год:неизвестен
- ISBN:нет данных
- Рейтинг книги:4 / 5. Голосов: 1
-
Избранное:Добавить в избранное
- Отзывы:
-
Ваша оценка:
- 80
- 1
- 2
- 3
- 4
- 5
Standard Template Library Programmer's Guide: краткое содержание, описание и аннотация
Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Standard Template Library Programmer's Guide»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.
Standard Template Library Programmer's Guide — читать онлайн бесплатно полную книгу (весь текст) целиком
Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Standard Template Library Programmer's Guide», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.
Интервал:
Закладка:
Function | Description |
---|---|
rope(const charT* s) |
Constructs a rope from a C string. The rope consists of the sequence of characters starting with *s up to, but not including, the first null character. |
rope(const charT* s, size_t n) |
Constructs a rope from an array of charT . The rope consists of the characters in the range [s, s + n) . Note that this range is permitted to contain embedded null characters. |
rope(charT c) |
Constructs a rope consisting of the single character c . |
rope(char_producer* cp, size_t n, bool destroy) |
Constructs a rope of size n , whose characters are computed as needed by cp . The object *cp must be valid as long as any reference to the resulting rope , or a rope derived from it, may be used. If destroy is true , then delete cp will be executed automatically once cp is no longer needed. Typically destroy will be true unless cp is a pointer to statically allocated storage. It is rarely safe to allocate *cp on the stack. |
size_type length() const |
Synonym for size |
iterator mutable_begin() |
Returns an iterator pointing to the beginning of the rope . This member function exists because mutable rope iterators are much more expensive than constant rope iterators. |
iterator mutable_end() |
Returns an iterator pointing to the end of the rope . This member function exists because mutable rope iterators are much more expensive than constant rope iterators. |
iterator mutable_rbegin() |
Returns a reverse_iterator pointing to the beginning of the reversed rope . This member function exists because mutable rope iterators are much more expensive than constant rope iterators. |
iterator mutable_rend() |
Returns a reverse_iterator pointing to the end of the reversed rope . This member function exists because mutable rope iterators are much more expensive than constant rope iterators. |
reference mutable_reference_at(size_type n) |
Returns a reference to the n th element. This member function exists because mutable references to rope elements have fairly high overhead. |
int compare(const rope& x) |
Three-way comparison, much like the function strcmp from the standard C library. Returns a negative number if *this is lexicographically less than x , a positive number if *this is lexicographically greater than x , and zero if neither rope is lexicographically less than the other. |
iterator insert(const iterator& p, const rope& x) |
Inserts the contents of the ropex immediately before the position p . |
iterator insert(const iterator& p, const charT* s) |
Inserts a C string immediately before the position p . The elements that are inserted are the sequence of characters starting with *s and up to, but not including, the first null character. |
iterator insert(const iterator& p, const charT* s, size_t n) |
Inserts an array of charT . The elements that are inserted are the range [s, s + n) . Note that this range is permitted to contain embedded null characters. |
void insert(size_t i, const rope& x) |
Inserts the contents of the rope x immediately before the i th element. |
void insert(size_t i, size_t n, charT c) |
Inserts n copies of c immediately before the i th element. |
void insert(size_t i, const charT* s) |
Inserts a C string immediately before the i th element. The elements that are inserted are the sequence of characters starting with *s and up to, but not including, the first null character. |
void insert(size_t i, const charT* s, size_t n) |
Inserts an array of charT immediately before the i th element. The elements that are inserted are the range [s, s + n) . Note that this range is permitted to contain embedded null characters. |
void insert(size_t i, charT c) |
Inserts the character c immediately before the i th element. |
void insert(size_t i) |
Inserts the character charT() immediately before the i th element. |
void insert(size_t i, const charT* f, const charT* l) |
Inserts the range [f, l) immediately before the i th element. |
void insert(size_t i, const const_iterator& f, const const_iterator& l) |
Inserts the range [f, l) immediately before the i th element. |
void insert(size_t i, const iterator& f, const iterator& l) |
Inserts the range [f, l) immediately before the i th element. |
void erase(size_t i, size_t n) |
Erases n elements, starting with the i th element. |
append(const charT* s) |
Adds a C string to the end of the rope . The elements that are inserted are the sequence of characters starting with *s and up to, but not including, the first null character. |
append(const charT* s, size_ nt) |
Adds an array of charT to the end of the rope . The elements that are inserted are the range [s, s + n) . Note that this range is permitted to contain embedded null characters. |
append(const charT* f, const charT* l) |
Adds the elements in the range [f, l) to the end of the rope . |
append(charT c) |
Adds the character c to the end of the rope . |
append() |
Adds the character charT() to the end of the rope. |
append(const rope& x) |
Adds the contents of the rope x to the end of *this . |
append(size_t n, charT c) |
Adds n copies of c to the end of *this . |
void replace(const iterator& f, const iterator& l, const rope& x) |
Replaces the elements in the range [f, l) with the elements in x . |
void replace(const iterator& f, const iterator& l, charT c) |
Replaces the elements in the range [f, l) with the single character c . |
void replace(const iterator& f, const iterator& l, const charT* s) |
Replaces the elements in the range [f, l) with a C string: the sequence of characters beginning with *s and up to, but not including, the first null character. |
void replace(const iterator& f, const iterator& l, const charT* s, size_t n) |
Replaces the elements in the range [f, l) with the elements in the range [s, s + n) . |
void replace(const iterator& f1, const iterator& l1, const charT* f2, const charT* l2) |
Replaces the elements in the range [f1, l1) with the elements in the range [f2, l2) . |
void replace(const iterator& f1, const iterator& l1, const const_iterator& f2, const const_iterator& l2) |
Replaces the elements in the range [f1, l1) with the elements in the range [f2, l2) . |
void replace(const iterator& f1, const iterator& l1, const iterator& f2, const iterator& l2) |
Replaces the elements in the range [f1, l1) with the elements in the range [f2, l2) . |
void replace(const iterator& p, const rope& x) |
Replaces the element pointed to by p with the elements in x . |
void replace(const iterator& p, charT c) |
Replaces the element pointed to by p with the single character c . |
void replace(const iterator& p, const charT* s) |
Replaces the element pointed to by p with a C string: the sequence of characters beginning with *s and up to, but not including, the first null character. |
void replace(const iterator& p, const charT* s, size_t n) |
Replaces the element pointed to by p with the elements in the range [s, s + n) . |
void replace(const iterator& p, const charT* f, const charT* l) |
Replaces the element pointed to by p with the elements in the range [f, l) . |
void replace(const iterator& p, const_iterator f, const_iterator l) |
Replaces the element pointed to by p with the elements in the range [f, l) . |
void replace(const iterator& p, iterator f, iterator l) |
Replaces the element pointed to by p with the elements in the range [f, l) . |
void replace(size_t i, size_t n, const rope& x) |
Replaces the n elements beginning with the i th element with the elements in x . |
void replace(size_t i, size_t n, charT c) |
Replaces the n elements beginning with the i th element with the single character c . |
void replace(size_t i, size_t n, const charT* s) |
Replaces the n elements beginning with the i th element with an array of charT : the sequence of characters beginning with *s and up to, but not including, the first null character. |
void replace(size_t i, size_t n1, const charT* s, size_t n2) |
Replaces the n1 elements beginning with the i th element with the elements in the range [s, s + n2) . |
void replace(size_t i, size_t n, const charT* f, const charT* l) |
Replaces the n elements beginning with the i th element with the characters in the range [f, l) . |
void replace(size_t i, size_t n, const const_iterator& f, const const_iterator& l) |
Replaces the n elements beginning with the i th element with the characters in the range [f, l) . |
void replace(size_t i, size_t n, const iterator& f, const iterator& l) |
Replaces the n elements beginning with the i th element with the characters in the range [f, l) . |
void replace(size_t i, charT c) |
Replaces the i th element with the character c . |
void replace(size_t i, const rope& x) |
Replaces the i th element with elements from the rope x. |
void replace(size_t i, const charT* s) |
Replaces the i th element with a C string: the sequence of characters beginning with *s and up to, but not including, the first null character. |
void replace(size_t i, const charT* s, size_t n) |
Replaces the i th element with the elements in the range [s, s + n) . |
void replace(size_t i, const charT* f, const charT* l) |
Replaces the i th element with the range [f, l) . |
void replace(size_t i, const const_iterator& f, const const_iterator& l) |
Replaces the i th element with the range [f, l) . |
void replace(size_t i, const iterator& f, const iterator& l) |
Replaces the i th element with the range [f, l) . |
rope substr(iterator f) const |
Returns a new rope with a single element, *f . [4] |
rope substr(const_iterator f) const |
Returns a new rope with a single element, *f . [4] |
rope substr(iterator f, iterator l) const | Returns a new rope that consists of the range [f, l) . [4] |
rope substr(const_iterator f, const_iterator l) const |
Returns a new rope that consists of the range [f, l) . [4] |
rope substr(size_t i, size_t n = 1) const |
Returns a new rope whose elements are the n characters starting at the position i . [4]. |
void copy(charT* buf) const |
Copies the characters in a rope into buf . |
size_type copy(size_type pos, size_type n, charT* buf) |
Copies n characters, starting at position pos in the rope , into buf . If the rope contains fewer than pos + n characters, then instead it only copies size() – pos characters. |
const charT* c_str() const |
Returns a pointer to a null-terminated sequence of characters that contains all of the characters in a rope . [5] [6] The resulting sequence of characters is valid at least as long as the rope remains valid and unchanged. Note that the first invocation of this operation on long strings is slow: it is linear in the length of the rope . |
void delete_c_str() |
Reclaims the internal storage used by c_str . Note that this invalidates the pointer that c_str returns. |
rope operator+(const rope& L, const rope& R) |
Returns a new rope consisting of the concatenation of L and R . This is a global function, not a member function. |
rope& operator+=(rope& L, const rope& R) |
Modifies L by appending R , and returns L . This is a global function, not a member function. |
rope operator+(const rope& L, const charT* s) |
Returns a new rope consisting of the concatenation of L and all of the characters from s up to, but not including, the first null character. This is a global function, not a member function. |
rope& operator+=(rope& L, const charT* s) |
Modifies L by appending the characters from s up to, but not including, the first null character. The return value is L . This is a global function, not a member function. |
rope operator+(const rope& L, charT c) |
Returns a new rope consisting of L with the character c appended to it. This is a global function, not a member function. |
rope& operator+=(rope& L, charT c) |
Modifies L by appending the character c . This is a global function, not a member function. |
ostream& operator<<(ostream& os, rope x) |
Outputs x to the stream os . This is a global function, not a member function. |
[1] For a detailed discussion of the rope data structure, see H.-J. Boehm, R. Atkinson, and M. Plass, "Ropes: An Alternative to Strings", Software Practice and Experience 25(12):1315, 1995.
Читать дальшеИнтервал:
Закладка:
Похожие книги на «Standard Template Library Programmer's Guide»
Представляем Вашему вниманию похожие книги на «Standard Template Library Programmer's Guide» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.
Обсуждение, отзывы о книге «Standard Template Library Programmer's Guide» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.