fork(2) download
  1. #include <functional>
  2.  
  3. typedef std::function<int(int, int)> op;
  4.  
  5. void UpdateValues(int X, int Y, op One, op Two)
  6. {
  7. //eventually doing something like
  8. One(X, 1);
  9. Two(Y, 2);
  10. }
  11.  
  12. int main()
  13. {
  14. op someOperator = std::plus<int>();
  15. op someOtherOperator = std::minus<int>();
  16. }
  17.  
Success #stdin #stdout 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty