adds first order functions to c++