Namespaces
Variants
Views
Actions

Strings library

From cppreference.com
< cpp
Revision as of 05:42, 7 July 2011 by P12 (Talk | contribs)

Template:cpp/string/sidebar

Contents

Null terminated narrow string management

Null-terminated wide string management

basic_string

Header <string> defines class template basic_string that generalizes the way how sequences of characters are manipulated and stored. It is defined as follows:

template<

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

> class basic_string;

Also, several specializations of the class basic_string are provided:

Template:tdcl list begin Template:tdcl list header Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list item Template:tdcl list end

Template:cpp/string/dcl list stoiTemplate:cpp/string/dcl list stofTemplate:cpp/string/dcl list to stringTemplate:cpp/string/dcl list to wstring

Functions

read data from an I/O stream into a string
(function)
Numeric conversions

Hash support

The following specializations of class template hash are defined. These specializations provide hash support for default string types.

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <string>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template<> class hash<string>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
template<> class hash<wstring>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
template<> class hash<u16string>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
template<> class hash<u32string>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> Template:ddcl list end

char_traits

Strings library provides class template char_traits, defining types and functions for a character container. The following specializations are defined:

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <string>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
template<> class char_traits<string>;
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
template<> class char_traits<wstring>;
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
template<> class char_traits<u16string>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
template<> class char_traits<u32string>;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> Template:ddcl list end