#include <vector> class MyClass { }; int main() { ::MyClass myObject; std::vector<::MyClass> myVectorOfMyClass; return 0; }
For it to compile, you have to add a space between '<' and ':'. "<:" is the digraph for '[', and this confuses the compiler. The Sun Compiler has a switch to enable it to tolerate the sytax. Reference: C++ Templates
No comments:
Post a Comment