I think MSVC++ is just generally really crappy when it comes to handling templates. I often get Internal Compiler Errors when using the STL. Sometimes inserting whitespace or comments, or just moving a couple of (completely template-unrelated) lines solves the problem (don''t ask me how
).
e.g. the following code (in a class decl) gave me an Internal Compiler Error
typedef std::pair< std::string, std::string > StringPair;typedef std::map< StringPair, std::string > PropertyMap;PropertyMap properties;
But after inserting a comment it worked:
typedef std::pair< std::string, std::string > StringPair;typedef std::map< StringPair, std::string > PropertyMap;/* foo */PropertyMap properties;
I can''t for the life of me figure out what was wrong.