2

Consider following piece of code:

std::unordered_set<int> foo {1, 2, 3, 4};
std::unordered_set<int> bar = std::move(foo);

This is pretty straightforward example. My question is - is foo still "usable" (and hopefully empty) after moving data or is it UB or implementation specific behaviour when I call after this something like this:

foo.insert(1);//is it valild??
bartop
  • 9,971
  • 1
  • 23
  • 54

0 Answers0