Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I though in c++ the lambda get created on the stack like any other object.


They do, but to actually use it, to pass it anywhere, you have to either wrap it in some other object (std::function, as comex pointed out) or use a template.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: