Hi,
I'm using Visual Studio 2008 with the Boost v1.42.0 library. If I use an enum as the template argument, I get a compile error when adding a value using push_back()
. The compiler error is: 'T': is not a legal base class
and the location of the error is move.hpp
line 79.
#include <boost/interprocess/containers/vector.hpp>
class Test {
public:
enum Types {
Unknown = 0,
First = 1,
Second = 2,
Third = 3
};
typedef boost::container::vector<Types> TypesVector;
};
int main() {
Test::TypesVector o;
o.push_back(Test::First);
return 0;
}
If I use a std::vector
instead it works. And if I resize the Boost version first and then set the values using the []
operator it also works.
Is there some way to make this work using push_back()
?
Template backtrace of the error:
error C2516: 'T' : is not a legal base class 1> main.cpp(21) : see declaration of 'T' 1> main.cpp(21) : see reference to class template instantiation 'boost::interprocess::rv' being compiled 1> with 1> [ 1> T=Test::Types 1> ]