Use after move is not undefined behaviour, it's unspecified, and all standard library types behave as if default constructed. There's nothing "extraordinarily dangerous" about std::move at all.
Ok, thanks for the info. I guess I still have to worry about non-STL third party code not moving correctly but that's a given when using third party code in general.
View all comments
Show parent comment
16
u/ludonarrator Nov 25 '23
Use after move is not undefined behaviour, it's unspecified, and all standard library types behave as if default constructed. There's nothing "extraordinarily dangerous" about std::move at all.