4 ms·
There are cases where you would not want to reject such code, though. For example, if std::move() is called inside a template function where the type in some in
by fluoridation 10mo ago
There are cases where you would not want to reject such code, though. For example, if std::move() is called inside a template function where the type in some instantiations resolves to const T, and the intent is indeed for the value to be copied. If move may in some cases cause a compiler error, then you would need to write specializations that don't call it.
- spot5010 10mo agoI didn’t think of that, but you are right. At some point I thought I understood templates r-value references work but now I’ve forgotten.