So I'm trying to get some code that is written for gcc to compile on Visual Studio 2008. I have a problem that I have narrowed down to this:
class value_t
{
public:
typedef std::deque<value_t> sequence_t;
typedef sequence_t::iterator iterator;
};
This code fails:
1>cpptest.cpp
1>c:\program files\microsoft visual studio 9.0\vc\include\deque(518) : error C2027: use of undefined type 'value_t'
1> c:\temp\cpptest\cpptest.cpp(10) : see declaration of 'value_t'
1> c:\temp\cpptest\cpptest.cpp(13) : see reference to class template instantiation 'std::deque<_Ty>' being compiled
1> with
1> [
1> _Ty=value_t
1> ]
1>c:\program files\microsoft visual studio 9.0\vc\include\deque(518) : error C2027: use of undefined type 'value_t'
1> c:\temp\cpptest\cpptest.cpp(10) : see declaration of 'value_t'
However when I try this with std::vector, it compiles fine:
class value_t
{
public:
typedef std::vector<value_t> sequence_t;
typedef sequence_t::iterator iterator;
};
What's wrong? I have tried adding 'typename' everywhere I can think of, but at this point in time I'm thinking it's just a bug in the Dinkumware STL. Can anyone explain what's happening, and/or offer a solution? Thanks.