Пространства имён
Варианты
Действия

std::basic_string

Материал из cppreference.com
 
 
 
std::basic_string
Функции-члены
basic_string::basic_string
basic_string::operator=
basic_string::assign
basic_string::get_allocator
Доступ к элементам
basic_string::at
basic_string::operator[]
basic_string::front(C++11)
basic_string::back(C++11)
basic_string::data
basic_string::c_str
Итераторы
basic_string::begin
basic_string::cbegin

(C++11)
basic_string::end
basic_string::cend

(C++11)
basic_string::rbegin
basic_string::crbegin

(C++11)
basic_string::rend
basic_string::crend

(C++11)
Вместимость
basic_string::empty
basic_string::size
basic_string::length
basic_string::max_size
basic_string::reserve
basic_string::capacity
basic_string::shrink_to_fit(C++11)
Операции
basic_string::clear
basic_string::insert
basic_string::erase
basic_string::push_back
basic_string::pop_back(C++11)
basic_string::append
basic_string::operator+=
basic_string::compare
basic_string::replace
basic_string::substr
basic_string::copy
basic_string::resize
basic_string::swap
Поиск
basic_string::find
basic_string::rfind
basic_string::find_first_of
basic_string::find_first_not_of
basic_string::find_last_of
basic_string::find_last_not_of
Константы
basic_string::npos
Функции-нечлены
operator+
operator==
operator!=
operator<
operator>
operator<=
operator>=
swap(std::basic_string)
operator<<
operator>>
getline
stoi
stol
stoll
(C++11)
(C++11)
(C++11)
stoul
stoull
(C++11)
(C++11)
stof
stod
stold
(C++11)
(C++11)
(C++11)
to_string(C++11)
to_wstring(C++11)
Вспомогательные классы
hash<std::string>
hash<std::wstring>
hash<std::u32string>
hash<std::u16string>
(C++11)
 
Заголовочный файл <string>
template<

    class CharT,
    class Traits = std::char_traits<CharT>,
    class Allocator = std::allocator<CharT>

> class basic_string;
Шаблон класса basic_string магазинах и манипулирует последовательности символов-подобных объектов (то есть объектов, для которых специализация std::char_traits или совместимый класс черты предусмотрен).
Original:
The class template basic_string stores and manipulates sequences of char-like objects (that is, objects for which a specialization of std::char_traits or compatible traits class is provided).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Элементы basic_string хранятся непрерывно, то есть для basic_string s, &*(s.begin() + n) == &*s.begin() + n для любого п в [0, s.size()), или, что эквивалентно, указатель на s[0] могут быть переданы функции, которые ожидают указатель на первый элемент массива charT[]. (начиная с C++11)
Original:
The elements of a basic_string are stored contiguously, that is, for a basic_string s, &*(s.begin() + n) == &*s.begin() + n for any n in [0, s.size()), or, equivalently, a pointer to s[0] can be passed to functions that expect a pointer to the first element of a charT[] array. (начиная с C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Несколько специализаций для распространенных типов характера предоставляются
Original:
Several specializations for common character types are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Определено в файле <string>
Type
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
std::string std::basic_string<char>
std::wstring std::basic_string<wchar_t>
std::u16string std::basic_string<char16_t>
std::u32string std::basic_string<char32_t>

Содержание

[править] Член типов

Член типа
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
traits_type Traits
value_type Traits::char_type
allocator_type Allocator [edit]
size_type Беззнаковый целочисленный тип (обычно size_t) [edit]
difference_type Знаковый целочисленный тип (обычно std::ptrdiff_t) [edit]
reference Allocator::reference (до C++11)
value_type& (начиная с C++11) [edit]
const_reference Allocator::const_reference (до C++11)
const value_type& (начиная с C++11) [edit]
pointer Allocator::pointer (до C++11)
std::allocator_traits<Allocator>::pointer (начиная с C++11) [edit]
const_pointer Allocator::const_pointer (до C++11)
std::allocator_traits<Allocator>::const_pointer (начиная с C++11) [edit]
iterator RandomAccessIterator [edit]
const_iterator Константный итератор с произвольным доступом [edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

[править] Член функций

строит basic_string
Original:
constructs a basic_string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
присваивает значения строки
Original:
assigns values to the string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
назначить символов в строку
Original:
assign characters to a string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает связанный распределителя
Original:
returns the associated allocator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Элемент доступа
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
доступ к указанным характера с проверкой границ
Original:
access specified character with bounds checking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
доступ к указанным характер
Original:
access specified character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
(C++11)
доступ к первому символу
Original:
accesses the first character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
(C++11)
доступ к последним символом
Original:
accesses the last character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает указатель на первый символ строки
Original:
returns a pointer to the first character of a string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает немодифицируемые стандартного C массив символов версию строки
Original:
returns a non-modifiable standard C character array version of the string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Итераторы
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
возвращает итератор на начало
Original:
returns an iterator to the beginning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]

(C++11)
возвращает итератор до конца
Original:
returns an iterator to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает обратный итератор на начало
Original:
returns a reverse iterator to the beginning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает обратный итератор до конца
Original:
returns a reverse iterator to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Потенциала
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
проверяет, является ли строка пустой
Original:
checks whether the string is empty
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
returns the number of characters
(публичная функция-член) [edit]
возвращает максимальное количество символов
Original:
returns the maximum number of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Запасы хранения
Original:
reserves storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает количество символов, которые могут быть проведены в настоящее время выделяются хранения
Original:
returns the number of characters that can be held in currently allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
уменьшает использование памяти, освобождая неиспользуемую память
Original:
reduces memory usage by freeing unused memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Операции
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
очищает содержимое
Original:
clears the contents
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
вставки символов
Original:
inserts characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
removes characters
(публичная функция-член) [edit]
добавляет характер до конца
Original:
appends a character to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
(C++11)
удаляет последний символ
Original:
removes the last character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
добавляет символы до конца
Original:
appends characters to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
добавляет символы до конца
Original:
appends characters to the end
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
сравнивает две строки
Original:
compares two strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
заменяет каждое вхождение указанного символа
Original:
replaces every occurrence of specified characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
возвращает подстроку
Original:
returns a substring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
копии символов
Original:
copies characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
изменяется количество символов сохранен
Original:
changes the number of characters stored
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
свопы содержание
Original:
swaps the contents
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Поиск
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Найти символы в строке
Original:
find characters in the string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
найти последнее вхождение подстроки
Original:
find the last occurrence of a substring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
найти первое вхождение символа
Original:
find first occurrence of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
найти первую отсутствие символов
Original:
find first absence of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
найти последнее вхождение символа
Original:
find last occurrence of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]
Найти последнюю отсутствие символов
Original:
find last absence of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(публичная функция-член) [edit]

Константы
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[статическим]
Особую ценность. Точное значение зависит от контекста
Original:
special value. The exact meaning depends on the context
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(общественности статический член постоянной) [edit]

[править] Не являющиеся членами функций

Объединяет две строки или строк и символов
Original:
concatenates two strings or a string and a char
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
лексикографически сравнивает две строки
Original:
lexicographically compares two strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
Специализируется std::swap алгоритм
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
Ввод / вывод
Original:
Input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
выполняет поток ввода / вывода строк
Original:
performs stream I/O on strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции) [edit]
читать данные из поток ввода / вывода в строку
Original:
read data from an I/O stream into a string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]
Числовые преобразования
Original:
Numeric conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
преобразует строку в целое число
Original:
converts a string to an signed integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]
(C++11)
(C++11)
преобразует строку в целое число без знака
Original:
converts a string to an unsigned integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]
(C++11)
(C++11)
(C++11)
преобразует строку в значение с плавающей точкой
Original:
converts a string to an floating point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]
(C++11)
преобразует целое или с плавающей запятой значение string
Original:
converts an integral or floating point value to string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]
преобразует целое или с плавающей запятой значение wstring
Original:
converts an integral or floating point value to wstring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(функция) [edit]

[править] Вспомогательные классы

хэш поддержка строк
Original:
hash support for strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(специализация шаблона класса) [edit]