Ok, so the last time I wrote C++ for a living, std::auto_ptr was all the std lib had available, and boost::shared_ptr was all the rage. I never really looked...
Why is it not allowed to get non-const reference to a temporary object, which function getx() returns? Clearly, this is prohibited by C++ Standard but I am interested in...
As far as I understand, the introduction of override keyword in C++11 is nothing more than a check to make sure that the function being implemented is the overrideing...
Came across a proposal called “rvalue reference for *this” in clang’s C++11 status page. I’ve read quite a bit about rvalue references and understood them, but I don’t think...
While I was trying to learn about C++ operators, I stumbled upon a strange comparison operator on cppreference.com,* in a table that looked like this: “Well, if these are...
What does the volatile keyword do? In C++ what problem does it solve? In my case, I have never knowingly needed it. 19 Answers 19
I am new to C++ programming, but I have experience in Java. I need guidance on how to pass objects to functions in C++. Do I need to pass...
I have a constructor that takes some arguments. I had assumed that they were constructed in the order listed, but in one case it appears they were being constructed...
I came across this strange code snippet which compiles fine: class Car { public: int speed; }; int main() { int Car::*pSpeed = &Car::speed; return 0; } Why does...
Let’s say I have the following class X where I want to return access to an internal member: class Z { // details }; class X { std::vector<Z> vecZ;...