The standard way of converting between numbers and strings in C++11 -- Marius Bancila
Quick: Would you resort to stringstream? But that's so C++98... and so hard.
More people need to know about to_string and its cousins. Marius Bancila takes us for a short tour:
The standard way of converting between numbers and strings in C++11
by Marius Bancila
From the article:
C++11 provides several standard functions for converting numbers to strings and strings to numbers, all of them available in the
<string>header.For converting numbers to strings there are two new overloaded functions:
to_string()andto_wstring(). They take one argument of various numeric types (int,long,long long,double,long double, etc.) and return either astd::stringor astd::wstringwith the number converted to text. ...For the other way around of converting strings to numbers there are several overloaded methods (taking either a
std::stringor astd::wstring): ...

Some high-performance techniques that you an use for more than just parsing, including this week's darling of memory management:
When you see anyone claim performance parity between <other language> and C++, one of the first things to look for is whether the C++ version of their test code is correctly using arrays and traversing them in order. If the test code is just doing equivalent pointer-chasing in both languages, the performance comparison is largely meaningless because the program is probably memory-bound and not properly written to use C++'s default container (
From the desk of an author going by the name Pubby, a nice short article showing off "yield return" using Boost's coroutines library: