fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. class SplitFunction {
  5. public:
  6. SplitFunction(int x, int y, double t) : this->x(x),
  7. this->y(y),
  8. this->t(t) { }
  9. bool operator()(std::vector<double> f) {
  10. return (f[x] - f[y]) < t;
  11. }
  12. private:
  13. int x, y;
  14. double t;
  15. };
  16.  
  17. int main() {
  18. SplitFunction s(1, 2, 3);
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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’
stdout
Standard output is empty