std::list binding problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

std::list binding problem

Shoooler
Hi everyone!

I was wondered by strange compiler errors that I can't understand.

When I bind std::list with int values, all seems ok:

module(luaState)
[
        class_<list<int>>("IntList")
                .def("erase", (list<int>::iterator(list<int>::*)(list<int>::const_iterator))&list<int>::erase)
                .def("insert", (list<int>::iterator(list<int>::*)(list<int>::const_iterator, const int&))&list<int>::insert)
];

but when I try to bind std::list with int*, compiler says that it can't convert function:

module(luaState)
[
        class_<list<int*>>("IntPointerList")
                .def("erase", (list<int*>::iterator(list<int*>::*)(list<int*>::const_iterator))&list<int*>::erase) // this line is ok
                .def("insert", (list<int*>::iterator(list<int*>::*)(list<int*>::const_iterator, const int&))&list<int*>::insert) // error here
];

Can you help me to bind std::list with pointers?

Thanks!