cplusplus
.com
教程
参考
文章
论坛
C++
教程
参考
文章
论坛
参考
C 库
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
输入/输出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多线程
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
<string>
类模板
basic_string
char_traits
类
string
C++11
u16string
C++11
u32string
wstring
函数
C++11
stod
C++11
stof
C++11
stoi
C++11
stol
C++11
stold
C++11
stoll
C++11
stoul
C++11
stoull
C++11
to_string
C++11
to_wstring
basic_string
basic_string::~basic_string
basic_string::basic_string
成员函数
basic_string::append
basic_string::assign
basic_string::at
C++11
basic_string::back
basic_string::begin
basic_string::c_str
basic_string::capacity
C++11
basic_string::cbegin
C++11
basic_string::cend
basic_string::clear
basic_string::compare
basic_string::copy
C++11
basic_string::crbegin
C++11
basic_string::crend
basic_string::data
basic_string::empty
basic_string::end
basic_string::erase
basic_string::find
basic_string::find_first_not_of
basic_string::find_first_of
basic_string::find_last_not_of
basic_string::find_last_of
C++11
basic_string::front
basic_string::get_allocator
basic_string::insert
basic_string::length
basic_string::max_size
basic_string::operator[]
basic_string::operator+=
basic_string::operator=
C++11
basic_string::pop_back
basic_string::push_back
basic_string::rbegin
basic_string::rend
basic_string::replace
basic_string::reserve
basic_string::resize
basic_string::rfind
C++11
basic_string::shrink_to_fit
basic_string::size
basic_string::substr
basic_string::swap
member constants
basic_string::npos
非成员重载
getline (basic_string)
operator+ (basic_string)
operator<< (basic_string)
operator>> (basic_string)
relational operators (basic_string)
swap (basic_string)
参考
<string>
basic_string
get_allocator
public member function
<string>
std::
basic_string
::get_allocator
allocator_type get_allocator() const;
allocator_type get_allocator() const noexcept;
Get allocator
Returns a copy of the allocator object associated with the
basic_string
.
参数
无
返回值
The allocator.
成员类型
allocator_type
is the type of the allocator used by the container, defined in
basic_string
as an alias of its third template parameter (
Alloc
).
复杂度
未指定,但通常是恒定的。
迭代器有效性
没有变化。
数据竞争
该对象被访问。
异常安全
无异常保证:
此成员函数从不抛出异常。
Copying any instantiation of the
default allocator
is also guaranteed to never throw.
另见
allocator
默认分配器
(类模板)