I don\'t see anything wrong with this code but it gives me a seg fault. Changing the std::function to a normal function solves the problem. Also removing the addition in the ove