C++11: initializer lists

image0

Prior C++11, curly braces could be used to initialize POD-compliant structures or classes only. In C++11, the use of curly braces has been extended. This improvement has been done partly for the new std::initializer_list object, that is useful when constructing sequence objects, for example a std::vector ...

more ...



User-defined literals

image1

source image

I deem this definition of a literal relevant:

Literal constants are invariants whose values are implied by their representations.

Literals are useful:

float million = 1e6;

C++11 now offers user-defined literals, which will be very handy, and not only as syntactic sugar. Consider the simple example of manipulating ...

more ...