Having only worked with gcc and clang, OP’s code looked completely fine to me and I was baffled why many comments think the code is at fault. Judging by this page [1], I agree this is entirely MSVC’s doing.
Yeah, Microsoft absolutely should've made their containers use throwing move-constructors in violation of the standard, in order to better adhere to the standard.
In reality, it's a defect in the standard, plus a quality-of-implementation issue in the Microsoft's C++ Standard Library.
In reality, it's a defect in the standard, plus a quality-of-implementation issue in the Microsoft's C++ Standard Library.