Currently it looks like this:
map<term_id, map<pair<document_id, positions_idx>> inverted_index;
Think you also meant to remove the pair in map<pair>?
Haha, apparently very hard to get this right. Fixed again.