std::begin

Defined in header <iterator> template< class C > auto begin( C& c ) -> decltype(c.begin()); (1) (since C++11) template< class C > auto begin( const C& c ) -> decltype(c.begin()); (1) (since C++11) (2) template< class T, std::size_t N > T* begin( T (&array)[N] ); (since C++11) (until C++14) template< class T, std::size_t N > constexpr T* begin( T (&array)[N] ); (since C++14) template< class C > constex

std::basic_stringstream::swap

void swap( basic_stringstream& other ); (since C++11) Exchanges the state of the stream with those of other. This is done by callingbasic_iostream<CharT, Traits>::swap(other) and rdbuf()->swap(*other.rdbuf()). Parameters other - stream to exchange the state with Return value (none). Example See also operator= (C++11) moves the string stream (public member function) swap (C++11) swaps two basic_stringbuf objects (public member function of st

std::basic_stringstream::str

std::basic_string<CharT,Traits,Allocator> str() const; (1) void str(const std::basic_string<CharT,Traits,Allocator>& new_str); (2) Manages the contents of the underlying string object. 1) Returns a copy of the underlying string as if by calling rdbuf()->str(). 2) Replaces the contents of the underlying string as if by calling rdbuf()->str(new_str). Parameters new_str - new contents of the underlying string Return value 1) a copy of the underlyin

std::basic_stringstream::rdbuf

std::basic_stringbuf<CharT, Traits, Allocator>* rdbuf() const; Returns pointer to the underlying raw string device object. Parameters (none). Return value Pointer to the underlying raw string device. Example

std::basic_stringstream::basic_stringstream

explicit basic_stringstream( ios_base::openmode mode = ios_base::in|ios_base::out ); (1) explicit basic_stringstream( const std::basic_string<CharT,Traits,Allocator>& str, ios_base::openmode mode = ios_base::in|ios_base::out ); (2) basic_stringstream( basic_stringstream&& other ); (3) (since C++11) Constructs new string stream. 1) Constructs new underlying string device. The underlying basic_stringbuf object is constructed as basic_strin

std::basic_stringstream

Defined in header <sstream> template< class CharT, class Traits = std::char_traits<CharT> > class basic_stringstream; (until C++11) template< class CharT, class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT> > class basic_stringstream; (since C++11) The class template std::basic_stringstream implements input/output operations on memory (std::basic_string) based streams. It essentially wra

std::basic_stringbuf::underflow

protected: virtual int_type underflow() Reads the next character from the get area of the buffer. Specifically: 1) If the input sequence has a read position available (egptr() > gptr()), returns Traits::to_int_type(*gptr()) 2) Otherwise, if pptr() > egptr() (some characters were inserted into the stream since the last time overflow() changed egptr()) then extends the end of the get area to include the most recently inserted characters, by changing egptr() to equal pptr(), and t

std::basic_stringbuf::swap

void swap( std::basic_stringbuf& rhs ) (since C++11) Swaps the state and the contents of *this and rhs. Parameters rhs - another basic_stringbuf Return value (none). Notes This function is called automatically when swapping std::stringstream objects, it is rarely necessary to call it directly. Example #include <sstream> #include <string> #include <iostream> int main() { std::istringstream one("one"); std::ostringstream two("two");

std::basic_stringbuf::str

std::basic_string<CharT, Traits, Allocator> str() const; (1) void str( const std::basic_string<CharT, Traits, Allocator>& s); (2) Gets and sets the underlying string. 1) Creates and returns a std::basic_string object containing a copy of this std::basic_stringbuf's underlying character sequence. For input-only streams, the returned string contains the characters from the range [eback(), egptr()). For input/output or output-only streams, contains the characters fro

std::basic_stringbuf::setbuf

protected: virtual std::basic_streambuf<CharT, Traits>* setbuf( char_type* s, std::streamsize n ) If s is a null pointer and n is zero, this function has no effect. Otherwise, the effect is implementation-defined: some implementations do nothing, while some implementations clear the std::string member currently used as the buffer and begin using the user-supplied character array of size n, whose first element is pointed to by s, as the buffer and the input/output character sequenc