
Hello,
I am having problems using a multi_index_container in the context of a
template class, and I am hoping someone here can help me. This is a
condensed example:
template<class T> struct C {
typedef multi_index_container<T> SomeSet;
SomeSet container;
// I learned I need typename, since this is an implicit type
typedef typename multi_index_container<T>::nth_index<0>::type
SomeSetIndex;
void f()
{
SomeSetIndex& index = container.get<0>();
}
};
The typedef for SomeSetIndex did not compile. g++-4.2 reported (I
stripped something from the message that I think is not relevant):
error: non-template 'nth_index' used as template
note: use 'multi_index_container