For a long time I thought that the ternary operator always returns an rvalue. But to my surprise it doesn't. In the following code I don't see the difference between the return value of foo and the return value of the ternary operator.
I've read that lvalues are "things with a defined storage location".And also that literals and temporaries variables are not lvalues, but no reason is given for this statement.
I ran into a rather subtle bug when using std::minmax with structured bindings. It appears that passed rvalues will not always be copied as one might expect. Originally I was using a T operator() const on a custom container, but it seems to be the same with a literal integer.
Since C++11, std::shuffle() takes an rvalue reference to a random bit generator:And so I might call it thus: