So, I have a code, that compiled on MSVC 9 and some previous (dunno how far back it goes...), GCC, MingW, GCC on Mac...
But one line, does not compile on MSVC:
class_< vector<unsigned int> >("LayerList")
.def(constructor<>())
.def("GetCount", &vector<unsigned int>::size)
.def("Get", &NumberGet)
.def("Add", &vector<unsigned int>::push_back) //this line refuses to compile
.def("__tostring", &LayerListToString)
If I comment it, the application compiles fine (but breaks at runtime), if I move this block somewhere else (even in other files) this particular line keeps giving errors... changing the order inside the block does not solve it too.
It gives 9 errors, most of them about wrong number of arguments in .def (some say there are 2 arguments when it expected 1, 3, 5 and one says "too much arguments"), and some about overloading failing, the most obvious one:
Error 7 error C2914: 'luabind::class_::def' : cannot deduce template argument as function argument is ambiguou E:\novashellSVN\clanlibstuff\novashell\source\ListBindings.cpp 178
This made me waste the entire work day... Someone has any clue on what changed on MSVC 10 to cause this? It is not anymore even bugging me because of the work stuck, but because how puzzling and strange it is.
EDIT: I compared the "vector" file, from MSVC 10, with other MSVC and GCC, and indeed in MSVC it has 3 versions, someone know EXACTLY how I make it load a specific version?
The three versions:
void push_back(const _Ty& _Val) //the one in GCC and older MSVC, thus the one I want
void push_back(_Ty&& _Val)
void push_back(bool _Val)