stlab / libraries

ASL libraries will be migrated here in the stlab namespace, new libraries will be created here.
https://stlab.cc
Boost Software License 1.0
660 stars 65 forks source link

add move implementation which asserts on providing const argument #544

Closed dhaibatc closed 5 months ago

dhaibatc commented 5 months ago

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