Avoiding self assignment in std::shuffle
The libstdc++ Debug Mode assertion is based on this rule in the standard, from [res.on.arguments] If a function argument binds to an rvalue reference parameter, the implementation may assume that this parameter is a unique reference to this argument. i.e. the implementation can assume that the object bound to the parameter of T::operator=(T&&) does not … Read more