It appears that basic_filebuf\'s move constructor does not close the target of move. cppreference\'s description reads
Move-constructs a std::basic_fileb