3 ms·
When you wrap a lambda into a std::function variable, it involves a call to a virtual function which add overheads (often unnoticed unless you repeat the call s
by pmelendez 12y ago
When you wrap a lambda into a std::function variable, it involves a call to a virtual function which add overheads (often unnoticed unless you repeat the call several times), so a regular recursive functor would be even faster.
The subject was discussed in the following threads:
http://stackoverflow.com/questions/2067988/recursive-lambda-functions-in-c0x/14591727#14591727 http://stackoverflow.com/questions/2067988/recursive-lambda-...
http://stackoverflow.com/questions/17066667/overhead-of-recursive-lambdas/17067042#17067042 http://stackoverflow.com/questions/17066667/overhead-of-recu...