c++ : split + bug fix for capturing lambdas