c – 使用一个值为std :: shared_ptr的map是一个很好的设计选择,有多个索引的类列表吗?
问题很简单: 我们有一个有成员a,b,c,d的班级…… 我们希望能够通过提供a或b或c的当前值来快速搜索(key是一个成员的值)并用新值更新类列表… 我想过要一堆 的std ::地图< decltype(MyClass.a / * B,C,d * /),的shared_ptr< MyClass的>取代. 1)这是个好主意吗? 2)boost multi index在各方面都优于这个手工解决方