Using multi-index as container type in templated class
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.
Following code demonstrates the problem:
// std includes
#include <iostream>
// boost includes
#include "boost/multi_index_container.hpp"
#include "boost/multi_index/ordered_index.hpp"
#include "boost/multi_index/sequenced_index.hpp"
using namespace std;
using namespace boost;
using namespace boost::multi_index;
// try also class keyword here
template<typename T>
class MultiIndex
{
public:
typedef T value_type;
typedef mpl::vector<
ordered_non_unique
participants (1)
-
Paul.VanHagen@shell.com