I realize there are better compilers out there but I have preferred to stick with vc6, every once in a while, I find weird flukes and was wondering if this one is localized to my installation or everyone's.
Keep in mind that the compiler in question is:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
(the linker, etc not relevant since this question doesnt seem to involve them)
Tried declaring a class inheriting from std::vector, which works fine, unless you also try to be specific with defining the second template parameter:
10: class foo : public std::vector<LPTSTR,std::allocator<LPTSTR>>
11: {
12: public:
13: foo();
14: ~foo();
15: };
does not compile and gives this error: c:\foo\foo.h(10) : error C2143: syntax error : missing '>' before '{'
now, the real question is, WHY is this legal:
10: class foo : public std::vector<LPTSTR,std::allocator<LPTSTR>>>
11: {
12: public:
13: foo();
14: ~foo();
15: };
note the extra >
at the end of line 10... and what I want to know is:
- did I do something wrong?
- is this only happening with my install?
- should I refrain from the workaround because it could cause problems later somehow?
I tried to research this as much as possible but as most programmers know it isn't so easy to search online because the search engines seem far to limited without even regular expression searches it becomes hit-or-miss and/or a popularity contest (is the topic of interest popular enough to be ranked up on Google, etc).
I thank you much in advance for your prompt (or even not prompt) reply on this one. I try to answer questions to others even if it seems ridiculously easy to me and try to remember knowledge always starts with lack of knowledge.