Use map instead of unordered map (it's not slower, and it's shorter). Use the default move constructor.