Arrow operator (->) in function heading
I came across the following code: template <typename T, typename T1> auto compose(T a, T1 b) -> decltype(a + b) { return a+b; … Read more
I came across the following code: template <typename T, typename T1> auto compose(T a, T1 b) -> decltype(a + b) { return a+b; … Read more
In his book The C++ Standard Library (Second Edition) Nicolai Josuttis states that lambdas can be better optimized by the compiler than plain … Read more
How do I capture by move (also known as rvalue reference) in a C++11 lambda? I am trying to write something like this: … Read more
If I declare a base class (or interface class) and specify a default value for one or more of its parameters, do the … Read more
I’ve read and heard that C++11 supports Unicode. A few questions on that: How well does the C++ standard library support Unicode? Does … Read more
I am new to C++11. I am writing the following recursive lambda function, but it doesn’t compile. sum.cpp #include <iostream> #include <functional> auto … Read more
From all the material I used to learn C++, auto has always been a weird storage duration specifier that didn’t serve any purpose. … Read more
Why does the reverse function for the std::list class in the C++ standard library have linear runtime? I would think that for doubly-linked … Read more
Just a small query regarding shared_ptr. Is it a good practice to use shared_ptr pointing to an array? For example, shared_ptr<int> sp(new int[10]); … Read more
What is the logic behind the “using” keyword in C++? It is used in different situations and I am trying to find if … Read more