boost::multi_index_container

テンプレートの嵐。

typedef boost::multi_index_container<
 ExistEntry,
 indexed_by<
  sequenced<>,
  hashed_unique<
   member,
   NodeIdentityHash
   >
  >
 > exist_type;

typedef exist_type::nth_index<0>::type SequencedIndex;
typedef exist_type::nth_index<1>::type NodeIndex;

とか。これはハッシュテーブル+Linked Listでアクセスできるコンテナ。


泣きそうなほどテンプレートなので、最初はstdext::hash_mapとstd::listを使って自分で書こうと思ったのだけど、トランザクション管理をやろうとするともっと泣けることに気づいた。