I'm trying to learn C++ 11. I'm confused about copy constructor and move constructor. Can anyone please tell me all the situations when a copy constructor is called and when a move constructor (also when not)? And besides, in exactly which cases the other constructors are used?
When the source of the copy is an rvalue - move constructor.
Otherwise, copy constructor.
However when the source of the copy is known to be an rvalue, one can avoid the potentially expensive clone() operation by pilfering the rvalue's pointer (no one will notice!). The move constructor above does exactly that http://www.artima.com/cppsource/rvalue.html
I'm sorry to say that these are all USELESS!
These are written as difficult as possible(especially cppreference), with no good, complete, explanatory examples. No one can start learning from here, only an expert can understand these.