Functions are said to be first class objects in C++. How is it possible to replicate the following pyhton code in C++?
def print_wrapper(a):
print(a)
def execute_function(func, arg):
return func(arg)
execute_function(print_wrapper, 'test_argument')
Please note that the function print_wrapper
is passed as an argument into the function execute_function
.