Ah, boost::multi_index! I tend to dream that one day this approach (with template mess cleaned using D capabilities) will find it's way to std.container So yummy.