Hacker News new | ask | show | jobs
by en4bz 3586 days ago
To swap nodes in the list you need to use splice like this:

keys_.splice(keys_.begin(), keys_, iter->second);

Where iter is from the cache lookup.