Except that the point of this isn't inlining, please look at the code again. Unfortunately, C++ doesn't have lambda expressions (for all I know).