Making C++ primitive types meaningfully movable when they have sentinel values -- Raymond Chen
A little less primitive...
Making C++ primitive types meaningfully movable when they have sentinel values
by Raymond Chen
From the article:
C++ primitive types do not have special semantics for move constructor or move assignment. Their move operations are just copies. But what if you really want them to move, say, because they have a sentinel value that represents an "empty" state...?


Are you a library person (std::function, std::bind, std::bind_front) or a language person (lambdas, auto, currying)? So many tools to get the job done...
A new instant classic for the new year, by the great Phil Nash of C++ on Sea...
Sending us straight into the new year with cash, cars, and games: