I have this very simple piece of code;
#include <deque>
#include <vector>
using namespace std;
class A
{
public:
A(){};
~A(){};
deque<A> my_array;
};
int main(void)
{
}
If I compile this code with both g ++ and icc / icpc on linux, it compiles fine, even if -Wallit does not give any warnings. If I change deque to a vector, the situation will be the same.
I would like to create this code on Windows using MSVCC (cl), but unfortunately it causes error c2027:
error C2027: use of undefined type 'A'
If, however, I change std::dequeto a std::vector, it compiles in Visual Studio 2010.
My question is: is this behavior expected for some reason? If so, why are there differences between compilers or is it a bug with g ++ / icc or MSVCC?
source
share