Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
basic_string
Strings Library
Summary
A templated class for handling sequences of character-like entities. string and wstring are specialized versions of basic_string
for chars and wchar_ts, respectively.
typedef basic_string <char> string;
typedef basic_string <wchar_t> wstring;
Contents
Synopsis●
Description●
Interface●
Constructors and Destructors●
Operators●
Iterators●
Allocator●
Member Functions●
Non-member Operators●
Non-member Function●
Example●
See Also●
Synopsis
#include <string>
template <class charT,
class traits = string_char_traits<charT>,
class Allocator = allocator>
class basic_string;
Description
basic_string<charT, traits, Allocator> is a homogeneous collection of character-like entities. It provides general string
functionality such as compare, append, assign, insert, remove, and replace , along with various searches. basic_string also
functions as an STL sequence container, providing random access iterators. This allows some of the generic algorithms to
apply to strings.
Any underlying character-like type may be used as long as an appropriate string_char_traits class is provided or the default
traits class is applicable.