Would it be a bad practice for some class S
to overload unary operator +
(or maybe operator *
for non-pointer-like classes) as following?
struct S { S && operator + () & noexcept { return std::move(*this); } };
The goal it to invent shorthand for std::move
.
S a;
S b = +a;
// instead of
S c = std::move(a);
Say I have a project with plenty of different classes, which intensively uses move-semantics. All the classes not mimics any arithmetical counterparts.