Array template

It is code from 2001 demonstrating use of templates. When I try to compile is it makes some errors. I belive the code was OK when the man did it in 2001 but for changes in C++ it makes errors now. Could somebody to try and maybe repair of the errors are not many?

This is array.h:
http://paste.ofcode.org/8cmZRx3tGryBHnVBh53QhE

and this is cpp:
http://paste.ofcode.org/NyTzkhTTdwjMeiQd4cswkR
please post the errors you get
array.h(158): warning C4346: 'www_builder_cz::Array<Typ>::iterator' : dependent name is not a type
prefix with 'typename' to indicate a type
array.h(158): error C2143: syntax error : missing ';' before 'www_builder_cz::Array<Typ>::begin'
array.h(158): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
array.h(158): error C2888: 'Array<Typ>::iterator iterator' : symbol cannot be defined within namespace 'www_builder_cz'
array.h(158): fatal error C1903: unable to recover from previous error(s); stopping compilation
example.cpp
example.cpp(19): error C2146: syntax error : missing ';' before identifier 'difference_type'
example.cpp(57) : see reference to class template instantiation 'Array<Typ>' being compiled
example.cpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
example.cpp(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Topic archived. No new replies allowed.