Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 946

Answer by HolyBlackCat for Can you declare a lambda variable without auto and/or templates?

$
0
0

No, the type of each lambda is unique and unnamed, so there's nothing you could replace auto with without at least some change in semantics.

std::function (and other std::..._function classes) have overhead, only use them if you need the ability to select one of several lambdas at runtime.

Function pointers should have no overhead, but can only point to capture-less lambdas, as explained in the other answers.


Viewing all articles
Browse latest Browse all 946

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>