why in the first line of this code:
template <typename VectorType>
std::string repr_vector_dynamic(const VectorType* vect)
{
std::stringstream strs;
strs << "(";
for (int i = 0; i < vect->size(); ++i) {
if (0 != i) {
strs << ", ";
}
strs << (*vect)[i];
}
strs << ")";
return strs.str();
}
I always get thsese errors at the first line: (MinGW gcc 4.5)
expected ';' before 'template'
expected primary-expression before 'template'
thx
later edit: here is the command line / log I got from eclipse:
g++ -II:\proj\bp\PyCML -IC:\PF\Python26\include -II:\proj\bp/include -O3 -Wall -c -fmessage-length=0 -oPyCML\cml.o ..\PyCML\cml.cpp
In file included from I:\proj\bp/include/boost/python/object/make_instance.hpp:9:0,
from I:\proj\bp/include/boost/python/object/make_ptr_instance.hpp:8,
from I:\proj\bp/include/boost/python/to_python_indirect.hpp:11,
from I:\proj\bp/include/boost/python/converter/arg_to_python.hpp:10,
from I:\proj\bp/include/boost/python/call.hpp:15,
from I:\proj\bp/include/boost/python/object_core.hpp:14,
from I:\proj\bp/include/boost/python/args.hpp:25,
from I:\proj\bp/include/boost/python.hpp:11,
from ..\PyCML\cml.cpp:11:
I:\proj\bp/include/boost/python/object/instance.hpp:14:36: warning: type attributes ignored after type is already defined
In file included from ..\PyCML\cml.cpp:28:0:
I:\proj\bp\PyCML/PyCMl/vector.h: In function 'void init_module_PyCML()':
I:\proj\bp\PyCML/PyCMl/vector.h:22:1: error: expected primary-expression before 'template'
I:\proj\bp\PyCML/PyCMl/vector.h:22:1: error: expected ';' before 'template'
..\PyCML\cml.cpp:58:1: error: expected '}' at end of input