Many a times programmers apply std::move on a const-lvalue or lvalue-const-reference, either directly or indirectly (lambda captures are implicitly immutable, unless the lambda is marked mutable), expecting the move-constructor or move-assignment to kick in, but that does not happen.
This version of stlab::move(moved_object); compile-time asserts when the type passed is const
Many a times programmers apply
std::move
on aconst-lvalue
orlvalue-const-reference
, either directly or indirectly (lambda captures are implicitly immutable, unless the lambda is markedmutable
), expecting the move-constructor or move-assignment to kick in, but that does not happen. This version ofstlab::move(moved_object);
compile-time asserts when the type passed isconst