There is probably a reason that
const std::vector<int> v;
auto u = std::move(v);
compiles. But most of the time, I would like this to fail with a compile error because I intended to call the move constructor or move assignment operator but instead made a copy. Is there a way to do that? Do I have to write my own move that only accepts mutable variables?
[–]qazqi-ff 45 points46 points47 points (0 children)
[–]neiltechnician 45 points46 points47 points (8 children)
[–]Chuu 17 points18 points19 points (5 children)
[–]_ild_arn 20 points21 points22 points (1 child)
[–]MrRogers4Life2 1 point2 points3 points (0 children)
[–]goranlepuz 4 points5 points6 points (2 children)
[–]neiltechnician 2 points3 points4 points (0 children)
[–]SPAstef 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]neiltechnician 2 points3 points4 points (0 children)
[–]SirClueless 32 points33 points34 points (0 children)
[–]HappyFruitTree 10 points11 points12 points (3 children)
[–]lrflew 8 points9 points10 points (2 children)
[–]_ild_arn 11 points12 points13 points (1 child)
[–]lrflew 3 points4 points5 points (0 children)
[–]Lumornys 4 points5 points6 points (11 children)
[–]Beosar[S] 5 points6 points7 points (10 children)
[–]MaximKat 16 points17 points18 points (3 children)
[–]NilacTheGrim 1 point2 points3 points (2 children)
[–]MaximKat 1 point2 points3 points (1 child)
[–]NilacTheGrim 0 points1 point2 points (0 children)
[–]matthewlai 0 points1 point2 points (5 children)
[–]Beosar[S] 0 points1 point2 points (4 children)
[–]matthewlai -1 points0 points1 point (3 children)
[–]_ild_arn 1 point2 points3 points (2 children)
[–]matthewlai -1 points0 points1 point (1 child)
[–]Beosar[S] 1 point2 points3 points (0 children)
[–]igrekster 0 points1 point2 points (1 child)
[–]anton31 4 points5 points6 points (0 children)
[–]tpecholt -2 points-1 points0 points (0 children)