rg3
09-02-2005, 12:07 PM
Hello, I have a somehow weird compile error when using a functor in C++ and I don't understand where the problem is. This is the code in question:
http://rafb.net/paste/results/9afr4p15.html
As you see, in the beginning of the file (line 13) I defined a functor to work as an adaptable binary function. It inherits from std::binary_function and, according to the template and the operator(), it receives two arguments of type `Casilla *' and `int', and it returns `void'.
`Casilla' objects have a `remove' method which needs an `int'. In line 44 I try to use this functor to call the `remove' method for each object pointed to from a vector. Note that the "casillas" member is of type `std::vector<Casilla *>', which is exactly what I need. Everything looks fine on my side but, when trying to compile the file. I get this (and only this) error:
http://rafb.net/paste/results/PCPgF854.html
The worst part is that I don't really understand what it's expecting (lines 6 and 7 in the error message). I do understand the only candidate it found, and I know that's what I have.
http://rafb.net/paste/results/9afr4p15.html
As you see, in the beginning of the file (line 13) I defined a functor to work as an adaptable binary function. It inherits from std::binary_function and, according to the template and the operator(), it receives two arguments of type `Casilla *' and `int', and it returns `void'.
`Casilla' objects have a `remove' method which needs an `int'. In line 44 I try to use this functor to call the `remove' method for each object pointed to from a vector. Note that the "casillas" member is of type `std::vector<Casilla *>', which is exactly what I need. Everything looks fine on my side but, when trying to compile the file. I get this (and only this) error:
http://rafb.net/paste/results/PCPgF854.html
The worst part is that I don't really understand what it's expecting (lines 6 and 7 in the error message). I do understand the only candidate it found, and I know that's what I have.