Valheru
16th August 2007, 21:00
And probably with templates in general - I've never used them outside of Qt's :)
I am trying to pass boost::array< float, int > as a function argument, but GCC is comlaining :
/home/lawrence/Projects/modelloader/src/modelloader.h:21: error: expected a constant of type ‘int’, got ‘unsigned int’
/home/lawrence/Projects/modelloader/src/modelloader.h:22: error: type/value mismatch at argument 2 in template parameter list for ‘template<class T, unsigned int N> class boost::array’
Also, in the implementation .cpp file when I try an create a boost::array it complains :
/home/lawrence/Projects/modelloader/src/objloader.cc:81: error: ‘num_vertices’ cannot appear in a constant-expression
/home/lawrence/Projects/modelloader/src/objloader.cc:81: error: template argument 2 is invalidAlso, I tried earlier to pass it as a pointer :
boost::array< float, int > *xIs that valid syntax?
TIA.
I am trying to pass boost::array< float, int > as a function argument, but GCC is comlaining :
/home/lawrence/Projects/modelloader/src/modelloader.h:21: error: expected a constant of type ‘int’, got ‘unsigned int’
/home/lawrence/Projects/modelloader/src/modelloader.h:22: error: type/value mismatch at argument 2 in template parameter list for ‘template<class T, unsigned int N> class boost::array’
Also, in the implementation .cpp file when I try an create a boost::array it complains :
/home/lawrence/Projects/modelloader/src/objloader.cc:81: error: ‘num_vertices’ cannot appear in a constant-expression
/home/lawrence/Projects/modelloader/src/objloader.cc:81: error: template argument 2 is invalidAlso, I tried earlier to pass it as a pointer :
boost::array< float, int > *xIs that valid syntax?
TIA.