#ifndef TEST_INTEROP_CXX_STDLIB_INPUTS_STD_FUNCTION_H #define TEST_INTEROP_CXX_STDLIB_INPUTS_STD_FUNCTION_H #include #include using FunctionIntToInt = std::function; using FunctionStringToString = std::function; using FunctionStringToStringConstRef = std::function; inline FunctionIntToInt getIdentityFunction() { return [](int x) { return x; }; } inline bool isEmptyFunction(FunctionIntToInt f) { return !(bool)f; } inline int invokeFunction(FunctionIntToInt f, int x) { return f(x); } std::string invokeFunctionTwice(FunctionStringToString f, std::string s) { return f(f(s)); } std::string invokeFunctionTwiceConstRef(FunctionStringToStringConstRef f, std::string s) { return f(f(s)); } #endif // TEST_INTEROP_CXX_STDLIB_INPUTS_STD_FUNCTION_H