Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::container::basic_string< CharT, Traits, Allocator > Class Template Reference

The basic_string class represents a Sequence of characters. More...

#include <string.hpp>

Inheritance diagram for boost::container::basic_string< CharT, Traits, Allocator >:
Collaboration diagram for boost::container::basic_string< CharT, Traits, Allocator >:

Classes

struct  Eq_traits
 
struct  Not_within_traits
 
struct  reserve_t
 

Public Types

typedef Traits traits_type
 
typedef CharT value_type
 
typedef
::boost::container::allocator_traits
< Allocator >::pointer 
pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::const_pointer 
const_pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::reference 
reference
 
typedef
::boost::container::allocator_traits
< Allocator >::const_reference 
const_reference
 
typedef
::boost::container::allocator_traits
< Allocator >::size_type 
size_type
 
typedef
::boost::container::allocator_traits
< Allocator >::difference_type 
difference_type
 
typedef Allocator allocator_type
 

Public Member Functions

typedef BOOST_CONTAINER_IMPDEF (allocator_type) stored_allocator_type
 
typedef BOOST_CONTAINER_IMPDEF (pointer) iterator
 
typedef BOOST_CONTAINER_IMPDEF (const_pointer) const _iterator
 
typedef BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< iterator >) reverse_iterator
 
typedef BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< const_iterator >) const _reverse_iterator
 
 basic_string (reserve_t, size_type n, const allocator_type &a=allocator_type())
 
 basic_string ()
 Effects: Default constructs a basic_string. More...
 
 basic_string (const allocator_type &a) BOOST_CONTAINER_NOEXCEPT
 Effects: Constructs a basic_string taking the allocator as parameter. More...
 
 basic_string (const basic_string &s)
 Effects: Copy constructs a basic_string. More...
 
 basic_string (BOOST_RV_REF(basic_string) s) BOOST_CONTAINER_NOEXCEPT
 Effects: Move constructor. More...
 
 basic_string (const basic_string &s, const allocator_type &a)
 Effects: Copy constructs a basic_string using the specified allocator. More...
 
 basic_string (BOOST_RV_REF(basic_string) s, const allocator_type &a)
 Effects: Move constructor using the specified allocator. More...
 
 basic_string (const basic_string &s, size_type pos, size_type n=npos, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s string. More...
 
 basic_string (const CharT *s, size_type n, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s c-string. More...
 
 basic_string (const CharT *s, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by the null-terminated s c-string. More...
 
 basic_string (size_type n, CharT c, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by n copies of c. More...
 
 basic_string (size_type n, default_init_t, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by n default-initialized characters. More...
 
template<class InputIterator >
 basic_string (InputIterator f, InputIterator l, const allocator_type &a=allocator_type())
 Effects: Constructs a basic_string taking the allocator as parameter, and a range of iterators. More...
 
 ~basic_string () BOOST_CONTAINER_NOEXCEPT
 Effects: Destroys the basic_string. More...
 
basic_stringoperator= (BOOST_COPY_ASSIGN_REF(basic_string) x)
 Effects: Copy constructs a string. More...
 
basic_stringoperator= (BOOST_RV_REF(basic_string) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type
 Effects: Move constructor. More...
 
basic_stringoperator= (const CharT *s)
 Effects: Assignment from a null-terminated c-string. More...
 
basic_stringoperator= (CharT c)
 Effects: Assignment from character. More...
 
allocator_type get_allocator () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a copy of the internal allocator. More...
 
stored_allocator_typeget_stored_allocator () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reference to the internal allocator. More...
 
const stored_allocator_typeget_stored_allocator () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reference to the internal allocator. More...
 
iterator begin () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns an iterator to the first element contained in the vector. More...
 
const_iterator begin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the vector. More...
 
iterator end () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns an iterator to the end of the vector. More...
 
const_iterator end () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the vector. More...
 
reverse_iterator rbegin () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the beginning of the reversed vector. More...
 
const_reverse_iterator rbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector. More...
 
reverse_iterator rend () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the end of the reversed vector. More...
 
const_reverse_iterator rend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector. More...
 
const_iterator cbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the vector. More...
 
const_iterator cend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the vector. More...
 
const_reverse_iterator crbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector. More...
 
const_reverse_iterator crend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector. More...
 
bool empty () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns true if the vector contains no elements. More...
 
size_type size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the number of the elements contained in the vector. More...
 
size_type length () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the number of the elements contained in the vector. More...
 
size_type max_size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the largest possible size of the vector. More...
 
void resize (size_type n, CharT c)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type n)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type n, default_init_t)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
size_type capacity () const BOOST_CONTAINER_NOEXCEPT
 Effects: Number of elements for which memory has been allocated. More...
 
void reserve (size_type res_arg)
 Effects: If n is less than or equal to capacity(), this call has no effect. More...
 
void shrink_to_fit ()
 Effects: Tries to deallocate the excess of memory created with previous allocations. More...
 
reference operator[] (size_type n) BOOST_CONTAINER_NOEXCEPT
 Requires: size() > n. More...
 
const_reference operator[] (size_type n) const BOOST_CONTAINER_NOEXCEPT
 Requires: size() > n. More...
 
reference at (size_type n)
 Requires: size() > n. More...
 
const_reference at (size_type n) const
 Requires: size() > n. More...
 
basic_stringoperator+= (const basic_string &s)
 Effects: Calls append(str.data, str.size()). More...
 
basic_stringoperator+= (const CharT *s)
 Effects: Calls append(s). More...
 
basic_stringoperator+= (CharT c)
 Effects: Calls append(1, c). More...
 
basic_stringappend (const basic_string &s)
 Effects: Calls append(str.data(), str.size()). More...
 
basic_stringappend (const basic_string &s, size_type pos, size_type n)
 Requires: pos <= str.size() More...
 
basic_stringappend (const CharT *s, size_type n)
 Requires: s points to an array of at least n elements of CharT. More...
 
basic_stringappend (const CharT *s)
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
basic_stringappend (size_type n, CharT c)
 Effects: Equivalent to append(basic_string(n, c)). More...
 
template<class InputIter >
basic_stringappend (InputIter first, InputIter last)
 Requires: [first,last) is a valid range. More...
 
void push_back (CharT c)
 Effects: Equivalent to append(static_cast<size_type>(1), c). More...
 
basic_stringassign (const basic_string &s)
 Effects: Equivalent to assign(str, 0, npos). More...
 
basic_stringassign (BOOST_RV_REF(basic_string) ms) BOOST_CONTAINER_NOEXCEPT
 Effects: The function replaces the string controlled by *this with a string of length str.size() whose elements are a copy of the string controlled by str. More...
 
basic_stringassign (const basic_string &s, size_type pos, size_type n)
 Requires: pos <= str.size() More...
 
basic_stringassign (const CharT *s, size_type n)
 Requires: s points to an array of at least n elements of CharT. More...
 
basic_stringassign (const CharT *s)
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
basic_stringassign (size_type n, CharT c)
 Effects: Equivalent to assign(basic_string(n, c)). More...
 
basic_stringassign (const CharT *first, const CharT *last)
 Effects: Equivalent to assign(basic_string(first, last)). More...
 
template<class InputIter >
basic_stringassign (InputIter first, InputIter last, typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value >::type *=0)
 Effects: Equivalent to assign(basic_string(first, last)). More...
 
basic_stringinsert (size_type pos, const basic_string &s)
 Requires: pos <= size(). More...
 
basic_stringinsert (size_type pos1, const basic_string &s, size_type pos2, size_type n)
 Requires: pos1 <= size() and pos2 <= str.size() More...
 
basic_stringinsert (size_type pos, const CharT *s, size_type n)
 Requires: s points to an array of at least n elements of CharT and pos <= size(). More...
 
basic_stringinsert (size_type pos, const CharT *s)
 Requires: pos <= size() and s points to an array of at least traits::length(s) + 1 elements of CharT More...
 
basic_stringinsert (size_type pos, size_type n, CharT c)
 Effects: Equivalent to insert(pos, basic_string(n, c)). More...
 
iterator insert (const_iterator p, CharT c)
 Requires: p is a valid iterator on *this. More...
 
iterator insert (const_iterator p, size_type n, CharT c)
 Requires: p is a valid iterator on *this. More...
 
template<class InputIter >
iterator insert (const_iterator p, InputIter first, InputIter last, typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value &&container_detail::is_input_iterator< InputIter >::value >::type *=0)
 Requires: p is a valid iterator on *this. More...
 
template<class ForwardIter >
iterator insert (const_iterator p, ForwardIter first, ForwardIter last, typename container_detail::enable_if_c< !container_detail::is_convertible< ForwardIter, size_type >::value &&!container_detail::is_input_iterator< ForwardIter >::value >::type *=0)
 
basic_stringerase (size_type pos=0, size_type n=npos)
 Requires: pos <= size() More...
 
iterator erase (const_iterator p) BOOST_CONTAINER_NOEXCEPT
 Effects: Removes the character referred to by p. More...
 
iterator erase (const_iterator first, const_iterator last) BOOST_CONTAINER_NOEXCEPT
 Requires: first and last are valid iterators on *this, defining a range [first,last). More...
 
void pop_back () BOOST_CONTAINER_NOEXCEPT
 Requires: !empty() More...
 
void clear () BOOST_CONTAINER_NOEXCEPT
 Effects: Erases all the elements of the vector. More...
 
basic_stringreplace (size_type pos1, size_type n1, const basic_string &str)
 Requires: pos1 <= size(). More...
 
basic_stringreplace (size_type pos1, size_type n1, const basic_string &str, size_type pos2, size_type n2)
 Requires: pos1 <= size() and pos2 <= str.size(). More...
 
basic_stringreplace (size_type pos1, size_type n1, const CharT *s, size_type n2)
 Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT. More...
 
basic_stringreplace (size_type pos, size_type n1, const CharT *s)
 Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT. More...
 
basic_stringreplace (size_type pos1, size_type n1, size_type n2, CharT c)
 Requires: pos1 <= size(). More...
 
basic_stringreplace (const_iterator i1, const_iterator i2, const basic_string &str)
 Requires: [begin(),i1) and [i1,i2) are valid ranges. More...
 
basic_stringreplace (const_iterator i1, const_iterator i2, const CharT *s, size_type n)
 Requires: [begin(),i1) and [i1,i2) are valid ranges and s points to an array of at least n elements More...
 
basic_stringreplace (const_iterator i1, const_iterator i2, const CharT *s)
 Requires: [begin(),i1) and [i1,i2) are valid ranges and s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
basic_stringreplace (const_iterator i1, const_iterator i2, size_type n, CharT c)
 Requires: [begin(),i1) and [i1,i2) are valid ranges. More...
 
template<class InputIter >
basic_stringreplace (const_iterator i1, const_iterator i2, InputIter j1, InputIter j2, typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value &&container_detail::is_input_iterator< InputIter >::value >::type *=0)
 Requires: [begin(),i1), [i1,i2) and [j1,j2) are valid ranges. More...
 
template<class ForwardIter >
basic_stringreplace (const_iterator i1, const_iterator i2, ForwardIter j1, ForwardIter j2, typename container_detail::enable_if_c< !container_detail::is_convertible< ForwardIter, size_type >::value &&!container_detail::is_input_iterator< ForwardIter >::value >::type *=0)
 
size_type copy (CharT *s, size_type n, size_type pos=0) const
 Requires: pos <= size() More...
 
void swap (basic_string &x)
 Effects: *this contains the same sequence of characters that was in s, s contains the same sequence of characters that was in *this. More...
 
const CharT * c_str () const BOOST_CONTAINER_NOEXCEPT
 Requires: The program shall not alter any of the values stored in the character array. More...
 
const CharT * data () const BOOST_CONTAINER_NOEXCEPT
 Requires: The program shall not alter any of the values stored in the character array. More...
 
size_type find (const basic_string &s, size_type pos=0) const
 Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: 19 pos <= xpos and xpos + str.size() <= size(); 2) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str. More...
 
size_type find (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least n elements of CharT. More...
 
size_type find (const CharT *s, size_type pos=0) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find (CharT c, size_type pos=0) const
 Throws: Nothing More...
 
size_type rfind (const basic_string &str, size_type pos=npos) const
 Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos + str.size() <= size(); b) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str. More...
 
size_type rfind (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least n elements of CharT. More...
 
size_type rfind (const CharT *s, size_type pos=npos) const
 Requires: pos <= size() and s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type rfind (CharT c, size_type pos=npos) const
 Throws: Nothing More...
 
size_type find_first_of (const basic_string &s, size_type pos=0) const
 Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str. More...
 
size_type find_first_of (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least n elements of CharT. More...
 
size_type find_first_of (const CharT *s, size_type pos=0) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_first_of (CharT c, size_type pos=0) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_last_of (const basic_string &str, size_type pos=npos) const
 Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str. More...
 
size_type find_last_of (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least n elements of CharT. More...
 
size_type find_last_of (const CharT *s, size_type pos=npos) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_last_of (CharT c, size_type pos=npos) const
 Throws: Nothing More...
 
size_type find_first_not_of (const basic_string &str, size_type pos=0) const
 Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str. More...
 
size_type find_first_not_of (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_first_not_of (const CharT *s, size_type pos=0) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_first_not_of (CharT c, size_type pos=0) const
 Throws: Nothing More...
 
size_type find_last_not_of (const basic_string &str, size_type pos=npos) const
 Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str. More...
 
size_type find_last_not_of (const CharT *s, size_type pos, size_type n) const
 Requires: s points to an array of at least n elements of CharT. More...
 
size_type find_last_not_of (const CharT *s, size_type pos=npos) const
 Requires: s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 
size_type find_last_not_of (CharT c, size_type pos=npos) const
 Throws: Nothing More...
 
basic_string substr (size_type pos=0, size_type n=npos) const
 Requires: Requires: pos <= size() More...
 
int compare (const basic_string &str) const
 Effects: Determines the effective length rlen of the string to copy as the smaller of size() and str.size(). More...
 
int compare (size_type pos1, size_type n1, const basic_string &str) const
 Requires: pos1 <= size() More...
 
int compare (size_type pos1, size_type n1, const basic_string &str, size_type pos2, size_type n2) const
 Requires: pos1 <= size() and pos2 <= str.size() More...
 
int compare (const CharT *s) const
 Throws: Nothing More...
 
int compare (size_type pos1, size_type n1, const CharT *s, size_type n2) const
 Requires: pos1 > size() and s points to an array of at least n2 elements of CharT. More...
 
int compare (size_type pos1, size_type n1, const CharT *s) const
 Requires: pos1 > size() and s points to an array of at least traits::length(s) + 1 elements of CharT. More...
 

Static Public Attributes

static const size_type npos = size_type(-1)
 

Private Types

typedef allocator_type stored_allocator_type
 

Private Member Functions

const Allocator & alloc () const
 
Allocator & alloc ()
 
bool is_short () const
 
void is_short (bool yes)
 
std::pair< pointer, bool > allocation_command (allocation_type command, size_type limit_size, size_type preferred_size, size_type &received_size, pointer reuse=0)
 
size_type next_capacity (size_type additional_objects) const
 
void deallocate (pointer p, size_type n)
 
void construct (pointer p, const value_type &value=value_type())
 
void destroy (pointer p, size_type n)
 
void destroy (pointer p)
 
void allocate_initial_block (size_type n)
 
void deallocate_block ()
 
size_type priv_capacity () const
 
pointer priv_short_addr () const
 
pointer priv_long_addr () const
 
void priv_long_addr (pointer addr)
 
pointer priv_addr () const
 
pointer priv_end_addr () const
 
size_type priv_storage () const
 
void priv_storage (size_type storage)
 
size_type priv_short_storage () const
 
size_type priv_long_storage () const
 
void priv_long_storage (size_type storage)
 
size_type priv_size () const
 
void priv_size (size_type sz)
 
size_type priv_short_size () const
 
void priv_short_size (size_type sz)
 
size_type priv_long_size () const
 
void priv_long_size (size_type sz)
 
void swap_data (basic_string_base &other)
 

Private Attributes

boost::container::container_detail::basic_string_base::members_holder members_
 

Static Private Attributes

static const size_type MinInternalBufferChars = 8
 
static const size_type AlignmentOfValueType
 
static const size_type ShortDataOffset
 
static const size_type ZeroCostInternalBufferChars
 
static const size_type UnalignedFinalInternalBufferChars
 

Detailed Description

template<class CharT, class Traits, class Allocator>
class boost::container::basic_string< CharT, Traits, Allocator >

The basic_string class represents a Sequence of characters.

It contains all the usual operations of a Sequence, and, additionally, it contains standard string operations such as search and concatenation.

The basic_string class is parameterized by character type, and by that type's Character Traits.

This class has performance characteristics very much like vector<>, meaning, for example, that it does not perform reference-count or copy-on-write, and that concatenation of two strings is an O(N) operation.

Some of basic_string's member functions use an unusual method of specifying positions and ranges. In addition to the conventional method using iterators, many of basic_string's member functions use a single value pos of type size_type to represent a position (in which case the position is begin() + pos, and many of basic_string's member functions use two values, pos and n, to represent a range. In that case pos is the beginning of the range and n is its size. That is, the range is [begin() + pos, begin() + pos + n).

Note that the C++ standard does not specify the complexity of basic_string operations. In this implementation, basic_string has performance characteristics very similar to those of vector: access to a single character is O(1), while copy and concatenation are O(N).

In this implementation, begin(), end(), rbegin(), rend(), operator[], c_str(), and data() do not invalidate iterators. In this implementation, iterators are only invalidated by member functions that explicitly change the string's contents.

Template Parameters
CharTThe type of character it contains.
TraitsThe Character Traits type, which encapsulates basic character operations
AllocatorThe allocator, used for internal memory management.

Member Typedef Documentation

template<class CharT, class Traits, class Allocator>
typedef Allocator boost::container::basic_string< CharT, Traits, Allocator >::allocator_type
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::basic_string< CharT, Traits, Allocator >::const_pointer
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::basic_string< CharT, Traits, Allocator >::const_reference
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::basic_string< CharT, Traits, Allocator >::difference_type
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::basic_string< CharT, Traits, Allocator >::pointer
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::basic_string< CharT, Traits, Allocator >::reference
template<class CharT, class Traits, class Allocator>
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::basic_string< CharT, Traits, Allocator >::size_type
template<class CharT, class Traits, class Allocator>
typedef Traits boost::container::basic_string< CharT, Traits, Allocator >::traits_type
template<class CharT, class Traits, class Allocator>
typedef CharT boost::container::basic_string< CharT, Traits, Allocator >::value_type

Constructor & Destructor Documentation

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( reserve_t  ,
size_type  n,
const allocator_type a = allocator_type() 
)
inline
template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( )
inline

Effects: Default constructs a basic_string.

Throws: If allocator_type's default constructor throws.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::substr().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const allocator_type a)
inlineexplicit

Effects: Constructs a basic_string taking the allocator as parameter.

Throws: Nothing

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const basic_string< CharT, Traits, Allocator > &  s)
inline

Effects: Copy constructs a basic_string.

Postcondition: x == *this.

Throws: If allocator_type's default constructor or allocation throws.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( BOOST_RV_REF(basic_string< CharT, Traits, Allocator >)  s)
inline
template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const basic_string< CharT, Traits, Allocator > &  s,
const allocator_type a 
)
inline

Effects: Copy constructs a basic_string using the specified allocator.

Postcondition: x == *this.

Throws: If allocation throws.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( BOOST_RV_REF(basic_string< CharT, Traits, Allocator >)  s,
const allocator_type a 
)
inline

Effects: Move constructor using the specified allocator.

Moves s's resources to *this.

Throws: If allocation throws.

Complexity: Constant if a == s.get_allocator(), linear otherwise.

References boost::container::container_detail::basic_string_base< Allocator >::alloc(), boost::container::basic_string< CharT, Traits, Allocator >::assign(), and boost::container::container_detail::basic_string_base< Allocator >::swap_data().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos,
size_type  n = npos,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s string.

References boost::container::basic_string< CharT, Traits, Allocator >::assign(), boost::math::tools::min_value(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const CharT *  s,
size_type  n,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s c-string.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( const CharT *  s,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by the null-terminated s c-string.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( size_type  n,
CharT  c,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by n copies of c.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( size_type  n,
default_init_t  ,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and is initialized by n default-initialized characters.

References boost::container::container_detail::basic_string_base< Allocator >::priv_size().

template<class CharT, class Traits, class Allocator>
template<class InputIterator >
boost::container::basic_string< CharT, Traits, Allocator >::basic_string ( InputIterator  f,
InputIterator  l,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a basic_string taking the allocator as parameter, and a range of iterators.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
boost::container::basic_string< CharT, Traits, Allocator >::~basic_string ( )
inline

Effects: Destroys the basic_string.

All used memory is deallocated.

Throws: Nothing.

Complexity: Constant.

Member Function Documentation

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::append ( const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos,
size_type  n 
)
inline

Requires: pos <= str.size()

Effects: Determines the effective length rlen of the string to append as the smaller of n and str.size() - pos and calls append(str.data() + pos, rlen).

Throws: If memory allocation throws and out_of_range if pos > str.size()

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append(), boost::math::tools::min_value(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::append ( const CharT *  s,
size_type  n 
)
inline

Requires: s points to an array of at least n elements of CharT.

Effects: The function replaces the string controlled by *this with a string of length size() + n whose irst size() elements are a copy of the original string controlled by *this and whose remaining elements are a copy of the initial n elements of s.

Throws: If memory allocation throws length_error if size() + n > max_size().

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::append ( const CharT *  s)
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Effects: Calls append(s, traits::length(s)).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::append ( size_type  n,
CharT  c 
)
inline

Effects: Equivalent to append(basic_string(n, c)).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append().

template<class CharT, class Traits, class Allocator>
template<class InputIter >
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::append ( InputIter  first,
InputIter  last 
)
inline

Requires: [first,last) is a valid range.

Effects: Equivalent to append(basic_string(first, last)).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::end(), and boost::container::basic_string< CharT, Traits, Allocator >::insert().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( const basic_string< CharT, Traits, Allocator > &  s)
inline
template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( BOOST_RV_REF(basic_string< CharT, Traits, Allocator >)  ms)
inline

Effects: The function replaces the string controlled by *this with a string of length str.size() whose elements are a copy of the string controlled by str.

Leaves str in a valid but unspecified state.

Throws: Nothing

Returns: *this

References boost::container::container_detail::basic_string_base< Allocator >::swap_data().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos,
size_type  n 
)
inline

Requires: pos <= str.size()

Effects: Determines the effective length rlen of the string to assign as the smaller of n and str.size() - pos and calls assign(str.data() + pos rlen).

Throws: If memory allocation throws or out_of_range if pos > str.size().

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::assign(), boost::math::tools::min_value(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( const CharT *  s,
size_type  n 
)
inline

Requires: s points to an array of at least n elements of CharT.

Effects: Replaces the string controlled by *this with a string of length n whose elements are a copy of those pointed to by s.

Throws: If memory allocation throws or length_error if n > max_size().

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( const CharT *  s)
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Effects: Calls assign(s, traits::length(s)).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( size_type  n,
CharT  c 
)
inline

Effects: Equivalent to assign(basic_string(n, c)).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
template<class InputIter >
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::assign ( InputIter  first,
InputIter  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value >::type = 0 
)
inline
template<class CharT, class Traits, class Allocator>
reference boost::container::basic_string< CharT, Traits, Allocator >::at ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::n, boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
const_reference boost::container::basic_string< CharT, Traits, Allocator >::at ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::n, boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
const_iterator boost::container::basic_string< CharT, Traits, Allocator >::begin ( ) const
inline

Effects: Returns a const_iterator to the first element contained in the vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

template<class CharT, class Traits, class Allocator>
typedef boost::container::basic_string< CharT, Traits, Allocator >::BOOST_CONTAINER_IMPDEF ( allocator_type  )
template<class CharT, class Traits, class Allocator>
typedef boost::container::basic_string< CharT, Traits, Allocator >::BOOST_CONTAINER_IMPDEF ( pointer  )
template<class CharT, class Traits, class Allocator>
typedef boost::container::basic_string< CharT, Traits, Allocator >::BOOST_CONTAINER_IMPDEF ( const_pointer  ) const
template<class CharT, class Traits, class Allocator>
typedef boost::container::basic_string< CharT, Traits, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< iterator >  )
template<class CharT, class Traits, class Allocator>
typedef boost::container::basic_string< CharT, Traits, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< const_iterator >  ) const
template<class CharT, class Traits, class Allocator>
const CharT* boost::container::basic_string< CharT, Traits, Allocator >::c_str ( ) const
inline

Requires: The program shall not alter any of the values stored in the character array.

Returns: Allocator pointer p such that p + i == &operator[](i) for each i in [0,size()].

Complexity: constant time.

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::capacity ( ) const
inline

Effects: Number of elements for which memory has been allocated.

capacity() is always greater than or equal to size().

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_capacity().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::insert(), and boost::container::basic_string< CharT, Traits, Allocator >::push_back().

template<class CharT, class Traits, class Allocator>
const_iterator boost::container::basic_string< CharT, Traits, Allocator >::cbegin ( ) const
inline

Effects: Returns a const_iterator to the first element contained in the vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::insert().

template<class CharT, class Traits, class Allocator>
const_iterator boost::container::basic_string< CharT, Traits, Allocator >::cend ( ) const
inline

Effects: Returns a const_iterator to the end of the vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_end_addr().

template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::clear ( )
inline
template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( const basic_string< CharT, Traits, Allocator > &  str) const
inline

Effects: Determines the effective length rlen of the string to copy as the smaller of size() and str.size().

The function then compares the two strings by calling traits::compare(data(), str.data(), rlen).

Throws: Nothing

Returns: The nonzero result if the result of the comparison is nonzero. Otherwise, returns a value < 0 if size() < str.size(), a 0 value if size() == str.size(), and value > 0 if size() > str.size()

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), and boost::container::container_detail::basic_string_base< Allocator >::priv_size().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::compare().

template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( size_type  pos1,
size_type  n1,
const basic_string< CharT, Traits, Allocator > &  str 
) const
inline

Requires: pos1 <= size()

Effects: Determines the effective length rlen of the string to copy as the smaller of

Throws: out_of_range if pos1 > size()

Returns:basic_string(*this,pos1,n1).compare(str).

References boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( size_type  pos1,
size_type  n1,
const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos2,
size_type  n2 
) const
inline

Requires: pos1 <= size() and pos2 <= str.size()

Effects: Determines the effective length rlen of the string to copy as the smaller of

Throws: out_of_range if pos1 > size() or pos2 > str.size()

Returns: basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2)).

References boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( const CharT *  s) const
inline
template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( size_type  pos1,
size_type  n1,
const CharT *  s,
size_type  n2 
) const
inline

Requires: pos1 > size() and s points to an array of at least n2 elements of CharT.

Throws: out_of_range if pos1 > size()

Returns: basic_string(*this, pos, n1).compare(basic_string(s, n2)).

References boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
int boost::container::basic_string< CharT, Traits, Allocator >::compare ( size_type  pos1,
size_type  n1,
const CharT *  s 
) const
inline

Requires: pos1 > size() and s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: out_of_range if pos1 > size()

Returns: basic_string(*this, pos, n1).compare(basic_string(s, n2)).

References boost::container::basic_string< CharT, Traits, Allocator >::compare().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::copy ( CharT *  s,
size_type  n,
size_type  pos = 0 
) const
inline

Requires: pos <= size()

Effects: Determines the effective length rlen of the string to copy as the smaller of n and size() - pos. s shall designate an array of at least rlen elements. The function then replaces the string designated by s with a string of length rlen whose elements are a copy of the string controlled by *this beginning at position pos. The function does not append a null object to the string designated by s.

Throws: if memory allocation throws, out_of_range if pos > size().

Returns: rlen

References boost::filesystem::detail::copy(), boost::python::len(), boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_out_of_range(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
const_reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::crbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_end_addr().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::rbegin().

template<class CharT, class Traits, class Allocator>
const_reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::crend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::rend().

template<class CharT, class Traits, class Allocator>
const CharT* boost::container::basic_string< CharT, Traits, Allocator >::data ( ) const
inline

Requires: The program shall not alter any of the values stored in the character array.

Returns: Allocator pointer p such that p + i == &operator[](i) for each i in [0,size()].

Complexity: constant time.

References boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
bool boost::container::basic_string< CharT, Traits, Allocator >::empty ( ) const
inline

Effects: Returns true if the vector contains no elements.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_size().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::clear().

template<class CharT, class Traits, class Allocator>
iterator boost::container::basic_string< CharT, Traits, Allocator >::end ( )
inline
template<class CharT, class Traits, class Allocator>
const_iterator boost::container::basic_string< CharT, Traits, Allocator >::end ( ) const
inline

Effects: Returns a const_iterator to the end of the vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_end_addr().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::erase ( size_type  pos = 0,
size_type  n = npos 
)
inline

Requires: pos <= size()

Effects: Determines the effective length xlen of the string to be removed as the smaller of n and size() - pos. The function then replaces the string controlled by *this with a string of length size() - xlen whose first pos elements are a copy of the initial elements of the original string controlled by *this, and whose remaining elements are a copy of the elements of the original string controlled by *this beginning at position pos + xlen.

Throws: out_of_range if pos > size().

Returns: *this

References boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::assign(), boost::container::basic_string< CharT, Traits, Allocator >::replace(), and boost::container::basic_string< CharT, Traits, Allocator >::resize().

template<class CharT, class Traits, class Allocator>
iterator boost::container::basic_string< CharT, Traits, Allocator >::erase ( const_iterator  p)
inline

Effects: Removes the character referred to by p.

Throws: Nothing

Returns: An iterator which points to the element immediately following p prior to the element being erased. If no such element exists, end() is returned.

References boost::fusion::move(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::container_detail::basic_string_base< Allocator >::priv_size(), boost::python::ptr(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
iterator boost::container::basic_string< CharT, Traits, Allocator >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Requires: first and last are valid iterators on *this, defining a range [first,last).

Effects: Removes the characters in the range [first,last).

Throws: Nothing

Returns: An iterator which points to the element pointed to by last prior to the other elements being erased. If no such element exists, end() is returned.

References boost::xpressive::first, boost::last, boost::fusion::move(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::container_detail::basic_string_base< Allocator >::priv_size(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find ( const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos = 0 
) const
inline

Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: 19 pos <= xpos and xpos + str.size() <= size(); 2) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find(), and boost::container::basic_string< CharT, Traits, Allocator >::find_first_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find ( const CharT *  s,
size_type  pos = 0 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_not_of ( const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos = 0 
) const
inline

Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find_first_not_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_not_of ( const CharT *  s,
size_type  pos,
size_type  n 
) const
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_not_of ( const CharT *  s,
size_type  pos = 0 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find_first_not_of(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find_first_not_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_of ( const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos = 0 
) const
inline

Effects: Determines the lowest position xpos, if possible, such that both of the following conditions obtain: a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find_first_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_of ( const CharT *  s,
size_type  pos,
size_type  n 
) const
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_of ( const CharT *  s,
size_type  pos = 0 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find_first_of(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find_first_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_first_of ( CharT  c,
size_type  pos = 0 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find_first_of(basic_string<CharT,traits,Allocator>(1,c), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_not_of ( const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos = npos 
) const
inline

Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find_last_not_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_not_of ( const CharT *  s,
size_type  pos,
size_type  n 
) const
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_not_of ( const CharT *  s,
size_type  pos = npos 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find_last_not_of(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find_last_not_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_of ( const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos = npos 
) const
inline

Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find_last_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_of ( const CharT *  s,
size_type  pos,
size_type  n 
) const
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_of ( const CharT *  s,
size_type  pos = npos 
) const
inline

Requires: s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: find_last_of(basic_string<CharT,traits,Allocator>(1,c),pos).

References boost::container::basic_string< CharT, Traits, Allocator >::find_last_of().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::find_last_of ( CharT  c,
size_type  pos = npos 
) const
inline

Throws: Nothing

Returns: find_last_of(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::rfind().

template<class CharT, class Traits, class Allocator>
allocator_type boost::container::basic_string< CharT, Traits, Allocator >::get_allocator ( ) const
inline

Effects: Returns a copy of the internal allocator.

Throws: If allocator's copy constructor throws.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::alloc().

template<class CharT, class Traits, class Allocator>
stored_allocator_type& boost::container::basic_string< CharT, Traits, Allocator >::get_stored_allocator ( )
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

References boost::container::container_detail::basic_string_base< Allocator >::alloc().

template<class CharT, class Traits, class Allocator>
const stored_allocator_type& boost::container::basic_string< CharT, Traits, Allocator >::get_stored_allocator ( ) const
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

References boost::container::container_detail::basic_string_base< Allocator >::alloc().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::insert ( size_type  pos1,
const basic_string< CharT, Traits, Allocator > &  s,
size_type  pos2,
size_type  n 
)
inline
template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::insert ( size_type  pos,
const CharT *  s,
size_type  n 
)
inline

Requires: s points to an array of at least n elements of CharT and pos <= size().

Effects: Replaces the string controlled by *this with a string of length size() + n whose first pos elements are a copy of the initial elements of the original string controlled by *this and whose next n elements are a copy of the elements in s and whose remaining elements are a copy of the remaining elements of the original string controlled by *this.

Throws: If memory allocation throws, out_of_range if pos > size() or length_error if size() + n > max_size().

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::insert(), boost::container::basic_string< CharT, Traits, Allocator >::max_size(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_length_error(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::insert ( size_type  pos,
const CharT *  s 
)
inline

Requires: pos <= size() and s points to an array of at least traits::length(s) + 1 elements of CharT

Effects: Calls insert(pos, s, traits::length(s)).

Throws: If memory allocation throws, out_of_range if pos > size() length_error if size() > max_size() - Traits::length(s)

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::insert(), boost::python::len(), boost::container::basic_string< CharT, Traits, Allocator >::max_size(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_length_error(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::insert ( size_type  pos,
size_type  n,
CharT  c 
)
inline
template<class CharT, class Traits, class Allocator>
iterator boost::container::basic_string< CharT, Traits, Allocator >::insert ( const_iterator  p,
CharT  c 
)
inline

Requires: p is a valid iterator on *this.

Effects: inserts a copy of c before the character referred to by p.

Returns: An iterator which refers to the copy of the inserted character.

References boost::container::basic_string< CharT, Traits, Allocator >::insert(), and boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

template<class CharT, class Traits, class Allocator>
iterator boost::container::basic_string< CharT, Traits, Allocator >::insert ( const_iterator  p,
size_type  n,
CharT  c 
)
inline

Requires: p is a valid iterator on *this.

Effects: Inserts n copies of c before the character referred to by p.

Returns: an iterator to the first inserted element or p if n is 0.

References boost::container::basic_string< CharT, Traits, Allocator >::insert().

template<class CharT, class Traits, class Allocator>
template<class InputIter >
iterator boost::container::basic_string< CharT, Traits, Allocator >::insert ( const_iterator  p,
InputIter  first,
InputIter  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value &&container_detail::is_input_iterator< InputIter >::value >::type = 0 
)
inline

Requires: p is a valid iterator on *this.

[first,last) is a valid range.

Effects: Equivalent to insert(p - begin(), basic_string(first, last)).

Returns: an iterator to the first inserted element or p if first == last.

References boost::container::basic_string< CharT, Traits, Allocator >::begin(), boost::container::basic_string< CharT, Traits, Allocator >::cbegin(), boost::xpressive::first, boost::container::basic_string< CharT, Traits, Allocator >::insert(), boost::last, and boost::multiprecision::backends::p.

template<class CharT, class Traits, class Allocator>
template<class ForwardIter >
iterator boost::container::basic_string< CharT, Traits, Allocator >::insert ( const_iterator  p,
ForwardIter  first,
ForwardIter  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< ForwardIter, size_type >::value &&!container_detail::is_input_iterator< ForwardIter >::value >::type = 0 
)
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::length ( ) const
inline

Effects: Returns the number of the elements contained in the vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::basic_string< CharT, Traits, Allocator >::size().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::max_size ( ) const
inline
template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator+= ( const basic_string< CharT, Traits, Allocator > &  s)
inline

Effects: Calls append(str.data, str.size()).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator+= ( const CharT *  s)
inline

Effects: Calls append(s).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::append().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator+= ( CharT  c)
inline

Effects: Calls append(1, c).

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::push_back().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator= ( BOOST_RV_REF(basic_string< CharT, Traits, Allocator >)  x)
inline

Effects: Move constructor.

Moves x's resources to *this.

Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and allocation throws

Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.

References boost::container::container_detail::basic_string_base< Allocator >::alloc(), boost::container::basic_string< CharT, Traits, Allocator >::assign(), BOOST_ASSERT, boost::container::basic_string< CharT, Traits, Allocator >::clear(), boost::container::container_detail::basic_string_base< Allocator >::swap_data(), boost::program_options::value(), boost::detail::void, and boost::flyweights::x.

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator= ( const CharT *  s)
inline

Effects: Assignment from a null-terminated c-string.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::operator= ( CharT  c)
inline

Effects: Assignment from character.

References boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
reference boost::container::basic_string< CharT, Traits, Allocator >::operator[] ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References boost::n, and boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

template<class CharT, class Traits, class Allocator>
const_reference boost::container::basic_string< CharT, Traits, Allocator >::operator[] ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References boost::n, and boost::container::container_detail::basic_string_base< Allocator >::priv_addr().

template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::pop_back ( )
inline
template<class CharT, class Traits, class Allocator>
reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::rbegin ( )
inline

Effects: Returns a reverse_iterator pointing to the beginning of the reversed vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::container_detail::basic_string_base< Allocator >::priv_end_addr().

template<class CharT, class Traits, class Allocator>
const_reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::rbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::basic_string< CharT, Traits, Allocator >::crbegin().

template<class CharT, class Traits, class Allocator>
reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::rend ( )
inline
template<class CharT, class Traits, class Allocator>
const_reverse_iterator boost::container::basic_string< CharT, Traits, Allocator >::rend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::basic_string< CharT, Traits, Allocator >::crend().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( size_type  pos1,
size_type  n1,
const basic_string< CharT, Traits, Allocator > &  str 
)
inline
template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( size_type  pos1,
size_type  n1,
const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos2,
size_type  n2 
)
inline

Requires: pos1 <= size() and pos2 <= str.size().

Effects: Determines the effective length rlen of the string to be inserted as the smaller of n2 and str.size() - pos2 and calls replace(pos1, n1, str.data() + pos2, rlen).

Throws: if memory allocation throws, out_of_range if pos1 > size() or pos2 > str.size().

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::max_size(), boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::replace(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_length_error(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( size_type  pos1,
size_type  n1,
const CharT *  s,
size_type  n2 
)
inline

Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT.

Effects: Determines the effective length xlen of the string to be removed as the smaller of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error. Otherwise, the function replaces the string controlled by *this with a string of length size() - xlen + n2 whose first pos1 elements are a copy of the initial elements of the original string controlled by *this, whose next n2 elements are a copy of the initial n2 elements of s, and whose remaining elements are a copy of the elements of the original string controlled by *this beginning at position pos + xlen.

Throws: if memory allocation throws, out_of_range if pos1 > size() or length_error if the length of the resulting string would exceed max_size()

Returns: *this

References boost::python::len(), boost::container::basic_string< CharT, Traits, Allocator >::max_size(), boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::replace(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_length_error(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( size_type  pos,
size_type  n1,
const CharT *  s 
)
inline

Requires: pos1 <= size() and s points to an array of at least n2 elements of CharT.

Effects: Determines the effective length xlen of the string to be removed as the smaller of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error. Otherwise, the function replaces the string controlled by *this with a string of length size() - xlen + n2 whose first pos1 elements are a copy of the initial elements of the original string controlled by *this, whose next n2 elements are a copy of the initial n2 elements of s, and whose remaining elements are a copy of the elements of the original string controlled by *this beginning at position pos + xlen.

Throws: if memory allocation throws, out_of_range if pos1 > size() or length_error if the length of the resulting string would exceed max_size()

Returns: *this

References boost::python::len(), boost::container::basic_string< CharT, Traits, Allocator >::max_size(), boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::replace(), boost::container::basic_string< CharT, Traits, Allocator >::size(), boost::container::throw_length_error(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( size_type  pos1,
size_type  n1,
size_type  n2,
CharT  c 
)
inline
template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
const basic_string< CharT, Traits, Allocator > &  str 
)
inline

Requires: [begin(),i1) and [i1,i2) are valid ranges.

Effects: Calls replace(i1 - begin(), i2 - i1, str).

Throws: if memory allocation throws

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::replace().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
const CharT *  s,
size_type  n 
)
inline

Requires: [begin(),i1) and [i1,i2) are valid ranges and s points to an array of at least n elements

Effects: Calls replace(i1 - begin(), i2 - i1, s, n).

Throws: if memory allocation throws

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::replace().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
const CharT *  s 
)
inline

Requires: [begin(),i1) and [i1,i2) are valid ranges and s points to an array of at least traits::length(s) + 1 elements of CharT.

Effects: Calls replace(i1 - begin(), i2 - i1, s, traits::length(s)).

Throws: if memory allocation throws

Returns: *this

References boost::container::basic_string< CharT, Traits, Allocator >::replace().

template<class CharT, class Traits, class Allocator>
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
size_type  n,
CharT  c 
)
inline

Requires: [begin(),i1) and [i1,i2) are valid ranges.

Effects: Calls replace(i1 - begin(), i2 - i1, basic_string(n, c)).

Throws: if memory allocation throws

Returns: *this

References boost::assign(), boost::container::basic_string< CharT, Traits, Allocator >::erase(), boost::container::basic_string< CharT, Traits, Allocator >::insert(), boost::python::len(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
template<class InputIter >
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
InputIter  j1,
InputIter  j2,
typename container_detail::enable_if_c< !container_detail::is_convertible< InputIter, size_type >::value &&container_detail::is_input_iterator< InputIter >::value >::type = 0 
)
inline

Requires: [begin(),i1), [i1,i2) and [j1,j2) are valid ranges.

Effects: Calls replace(i1 - begin(), i2 - i1, basic_string(j1, j2)).

Throws: if memory allocation throws

Returns: *this

References boost::assign(), boost::container::basic_string< CharT, Traits, Allocator >::erase(), boost::container::basic_string< CharT, Traits, Allocator >::insert(), and boost::interprocess::to_raw_pointer().

template<class CharT, class Traits, class Allocator>
template<class ForwardIter >
basic_string& boost::container::basic_string< CharT, Traits, Allocator >::replace ( const_iterator  i1,
const_iterator  i2,
ForwardIter  j1,
ForwardIter  j2,
typename container_detail::enable_if_c< !container_detail::is_convertible< ForwardIter, size_type >::value &&!container_detail::is_input_iterator< ForwardIter >::value >::type = 0 
)
inline
template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::reserve ( size_type  res_arg)
inline

Effects: If n is less than or equal to capacity(), this call has no effect.

Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.

Throws: If memory allocation allocation throws

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::assign().

template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::resize ( size_type  n,
CharT  c 
)
inline
template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::resize ( size_type  n)
inline

Effects: Inserts or erases elements at the end such that the size becomes n.

New elements are value initialized.

Throws: If memory allocation throws

Complexity: Linear to the difference between size() and new_size.

References boost::container::basic_string< CharT, Traits, Allocator >::resize().

template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::resize ( size_type  n,
default_init_t   
)
inline

Effects: Inserts or erases elements at the end such that the size becomes n.

New elements are uninitialized.

Throws: If memory allocation throws

Complexity: Linear to the difference between size() and new_size.

Note: Non-standard extension

References boost::container::basic_string< CharT, Traits, Allocator >::begin(), boost::container::basic_string< CharT, Traits, Allocator >::end(), boost::container::basic_string< CharT, Traits, Allocator >::erase(), boost::container::container_detail::basic_string_base< Allocator >::priv_size(), and boost::container::basic_string< CharT, Traits, Allocator >::size().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::rfind ( const basic_string< CharT, Traits, Allocator > &  str,
size_type  pos = npos 
) const
inline

Effects: Determines the highest position xpos, if possible, such that both of the following conditions obtain: a) xpos <= pos and xpos + str.size() <= size(); b) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str.

Throws: Nothing

Returns: xpos if the function can determine such a value for xpos. Otherwise, returns npos.

Referenced by boost::container::basic_string< CharT, Traits, Allocator >::find_last_of(), and boost::container::basic_string< CharT, Traits, Allocator >::rfind().

template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::rfind ( const CharT *  s,
size_type  pos,
size_type  n 
) const
inline
template<class CharT, class Traits, class Allocator>
size_type boost::container::basic_string< CharT, Traits, Allocator >::rfind ( const CharT *  s,
size_type  pos = npos 
) const
inline

Requires: pos <= size() and s points to an array of at least traits::length(s) + 1 elements of CharT.

Throws: Nothing

Returns: rfind(basic_string(s), pos).

References boost::container::basic_string< CharT, Traits, Allocator >::rfind().

template<class CharT, class Traits, class Allocator>
basic_string boost::container::basic_string< CharT, Traits, Allocator >::substr ( size_type  pos = 0,
size_type  n = npos 
) const
inline

Requires: Requires: pos <= size()

Effects: Determines the effective length rlen of the string to copy as the smaller of n and size() - pos.

Throws: If memory allocation throws or out_of_range if pos > size().

Returns: basic_string<CharT,traits,Allocator>(data()+pos,rlen).

References boost::container::container_detail::basic_string_base< Allocator >::alloc(), boost::container::basic_string< CharT, Traits, Allocator >::basic_string(), boost::math::tools::min_value(), boost::container::container_detail::basic_string_base< Allocator >::priv_addr(), boost::container::basic_string< CharT, Traits, Allocator >::size(), and boost::container::throw_out_of_range().

template<class CharT, class Traits, class Allocator>
void boost::container::basic_string< CharT, Traits, Allocator >::swap ( basic_string< CharT, Traits, Allocator > &  x)
inline

Effects: *this contains the same sequence of characters that was in s, s contains the same sequence of characters that was in *this.

Throws: Nothing

References boost::container::container_detail::basic_string_base< Allocator >::alloc(), and boost::container::container_detail::basic_string_base< Allocator >::swap_data().

Member Data Documentation


The documentation for this class was generated from the following files: