Hi Paul, Paul.VanHagen@shell.com ha escrito:
Hello,
I am having trouble using a boost::multi_index_container type in a template class where the multi-index value type is depending on the template arg type of the class.
In particular, I'm getting compiler errors when trying to define the iterator and index types using the "type" typedefs in the multi_index container. Apparently, at compile time the index and iterator types cannot be deduced resulting in errors like "cannot convert to typename, etc.".
I'm using GCC 3.3.1 and Boost 1.34.1.
Well, seems like the compiler is having a hard time with dependent nested types.
Probably newer versions of GCC will pose less problems. Fortunately, you can
use global variants for nth_index etc., which happen to be easier for the compiler.
So, instead of
typedef typename mi::nth_index<0>::type mi_by_value;
you can write
typedef typename nth_index