just a small syntax question
-
I have a question about the syntax when it comes to templates. What I want to do is to create a pointer to a std::vector which contains pointers to a class called Square. I thought it would look like: std::vector< Square* >*, but obviously my compiler thinks not and gives me "error C2059: syntax error : '>'". Any help appriacted :)
-
I have a question about the syntax when it comes to templates. What I want to do is to create a pointer to a std::vector which contains pointers to a class called Square. I thought it would look like: std::vector< Square* >*, but obviously my compiler thinks not and gives me "error C2059: syntax error : '>'". Any help appriacted :)
That is correct syntax. Are you using VC6 and have you #include <vector>? VC6's a bit a wacko when it comes to templates. Try this and see what happens:
typedef Square* SquarePtr;
std::vector<SquarePtr>* pVector;-- Gott weiß ich will kein Engel sein.
-
That is correct syntax. Are you using VC6 and have you #include <vector>? VC6's a bit a wacko when it comes to templates. Try this and see what happens:
typedef Square* SquarePtr;
std::vector<SquarePtr>* pVector;-- Gott weiß ich will kein Engel sein.
-
I use VS.net 2003 and have vector included. What you suggested seems to work though, thx a lot :)
:confused: That's odd! I haven't seen any weirdness like that from vs.net 2003. -- Gott weiß ich will kein Engel sein.