0

boost :: multi_index_container(次のように)を使用していますが、インデックスをtypedefしようとすると、コンパイルエラーが発生します:

struct del_t
{
  string del_id;
  string dev_version;
};

struct count_container_t
{
  uint32_t count_1;
  uint32_t count_2;
};

struct mic_t
{
  del_t d;
  uint32_t p;
  string c;
  map<uint32_t, count_container_t> b;
};

typedef multi_index_container
<mic_t,

 indexed_by
 <ordered_unique<member<mic_t,
                        del_t,
                        &mic_t::d>
                 >
  >
 > super_mic_t;

//The following line is causing the compile error. Compiles fine without it.
typedef super_mic_t::nth_index<0>::type zeroth_index_t; 

エラーの詳細:

/usr/include/boost/multi_index/detail/base_type.hpp:54: error: invalid use 
of incomplete type 'struct 
boost::multi_index::ordered_unique<boost::multi_index::member<mic_t, 
del_t, &mic_t::d>, mpl_::na, mpl_::na>'

typename使用のバリエーションを試しtemplateましたが、私はそれを正しく行っていないと思います(問題を正しく理解していないため、正しく解決することができます)。

どんな助けでも大歓迎です。

ありがとう。

PS:「g ++(GCC)4.2.4(Ubuntu 4.2.4-1ubuntu4)」と「boost-1.42」を使用しています。

4

1 に答える 1

3

おそらくのために、必要なインクルードが欠落している可能性がありordered_unique::nth_indexます。

于 2011-03-04T14:39:20.447 に答える