#include <iostream>
#include <vector>
class SplitFunction {
public:
SplitFunction(int x, int y, double t) : this->x(x),
this->y(y),
this->t(t) { }
bool operator()(std::vector<double> f) {
return (f[x] - f[y]) < t;
}
private:
int x, y;
double t;
};
int main() {
SplitFunction s(1, 2, 3);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKY2xhc3MgU3BsaXRGdW5jdGlvbiB7CiAgcHVibGljOgogICAgU3BsaXRGdW5jdGlvbihpbnQgeCwgaW50IHksIGRvdWJsZSB0KSA6IHRoaXMtPngoeCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy0+eSh5KSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLT50KHQpIHsgfQogICAgYm9vbCBvcGVyYXRvcigpKHN0ZDo6dmVjdG9yPGRvdWJsZT4gZikgewogICAgICByZXR1cm4gKGZbeF0gLSBmW3ldKSA8IHQ7CiAgICB9CiAgcHJpdmF0ZToKICAgIGludCB4LCB5OwogICAgZG91YmxlIHQ7Cn07CgppbnQgbWFpbigpIHsKCVNwbGl0RnVuY3Rpb24gcygxLCAyLCAzKTsKCXJldHVybiAwOwp9
prog.cpp: In constructor ‘SplitFunction::SplitFunction(int, int, double)’:
prog.cpp:6:45: error: expected identifier before ‘this’
SplitFunction(int x, int y, double t) : this->x(x),
^
prog.cpp:6:45: error: expected ‘{’ before ‘this’