How to “return an object” in C++?
I know the title sounds familiar as there are many similar questions, but I’m asking for a different aspect of the problem (I … Read more
I know the title sounds familiar as there are many similar questions, but I’m asking for a different aspect of the problem (I … Read more
Something I have found myself doing often lately is declaring typedefs relevant to a particular class inside that class, i.e. class Lorem { … 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
In c++14 the decltype(auto) idiom is introduced. Typically its use is to allow auto declarations to use the decltype rules on the given … Read more
Suppose I have a class with private memebers ptr, name, pname, rname, crname and age. What happens if I don’t initialize them myself? … Read more
I got this question when I received a code review comment saying virtual functions need not be inline. I thought inline virtual functions … 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
I am wondering what the difference is between typeid and typeof in C++. Here’s what I know: typeid is mentioned in the documentation … Read more
In C++, Why is a boolean 1 byte and not 1 bit of size? Why aren’t there types like a 4-bit or 2-bit … Read more
So I’ve been getting some mysterious uninitialized values message from valgrind and it’s been quite the mystery as of where the bad value … Read more