std::basic_string::back

CharT& back(); (since C++11) const CharT& back() const; (since C++11) Returns reference to the last character in the string. The behavior is undefined if empty() == true. Parameters (none). Return value reference to the last character, equivalent to operator[](size() - 1). Complexity Constant. Example #include <iostream> #include <string> int main() { { std::string s("Exemplary"); char& back = s.back(); back = 's'; std::cou

std::basic_string::at

reference at( size_type pos ); const_reference at( size_type pos ) const; Returns a reference to the character at specified location pos. Bounds checking is performed, exception of type std::out_of_range will be thrown on invalid access. Parameters pos - position of the character to return Return value Reference to the requested character. Exceptions Throws std::out_of_range if pos >= size(). Complexity Constant. Example #include <stdexcept>

std::basic_string::assign

basic_string& assign( size_type count, CharT ch ); (1) basic_string& assign( const basic_string& str ); (2) (3) basic_string& assign( const basic_string& str, size_type pos, size_type count ); (until C++14) basic_string& assign( const basic_string& str, size_type pos, size_type count = npos); (since C++14) basic_string& assign( basic_string&& s

std::basic_string::append

basic_string& append( size_type count, CharT ch ); (1) basic_string& append( const basic_string& str ); (2) (3) basic_string& append( const basic_string& str, size_type pos, size_type count ); (until C++14) basic_string& append( const basic_string& str, size_type pos, size_type count = npos); (since C++14) basic_string& append( const CharT* s,

std::basic_string

Defined in header <string> template< class CharT, class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT> > class basic_string; The class template basic_string stores and manipulates sequences of char-like objects. The class is dependent neither on the character type nor on the nature of operations on that type. The definitions of the operations are supplied via the Traits template parameter - a specialization of std:

std::basic_streambuf::underflow

virtual int_type underflow(); Ensures that at least one character is available in the input area by updating the pointers to the input area (if needed) and reading more data in from the input sequence (if applicable). Returns the value of that character (converted to int_type with Traits::to_int_type(c)) on success or Traits::eof() on failure. The function may update gptr, egptr and eback pointers to define the location of newly loaded data (if any). On failure, the function ensures tha

std::basic_streambuf::uflow

virtual int_type uflow(); Ensures that at least one character is available in the input area by updating the pointers to the input area (if needed). On success returns the value of that character and advances the value of the get pointer by one character. On failure returns traits::eof(). The function may update gptr, egptr and eback pointers to define the location of newly loaded data (if any). On failure, the function ensures that either gptr() == nullptr or gptr() == egptr. The base

std::basic_streambuf::swap

void swap( basic_streambuf& other ); (since C++11) Exchanges the contents of the stream buffer with those of other. Parameters other - stream buffer to exchange contents with Return value (none). Exceptions (none). Example

std::basic_streambuf::sungetc

int_type sungetc(); If a putback position is available in the get area (gptr() > eback()), then decrements the next pointer (gptr()) and returns the character it now points to. If a putback position is not available, then calls pbackfail() to back up the input sequence if possible. The I/O stream function basic_istream::unget is implemented in terms of this function. Parameters (none). Return value If putback position was available, returns the character that the next pointer i

std::basic_streambuf::sputn

std::streamsize sputn( const char_type* s, std::streamsize count ); (1) protected: virtual std::streamsize xsputn( const char_type* s, std::streamsize count ); (2) 1) Calls xsputn(s, count) of the most derived class. 2) Writes count characters to the output sequence from the character array whose first element is pointed to by s. The characters are written as if by repeated calls to sputc(). Writing stops when either count characters are written or a call to sputc() would have r