Timeline for Function returning a lambda expression
Current License: CC BY-SA 3.0
Post Revisions
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 27, 2020 at 17:33 | answer | added | Tono Nam | timeline score: 0 | |
| Aug 23, 2019 at 16:26 | answer | added | Terens Tare | timeline score: 1 | |
| Jun 29, 2016 at 10:17 | comment | added | jotik |
One can use the + operator to convert a lambda to a function pointer.
|
|
| Jun 29, 2016 at 10:15 | history | edited | jotik | CC BY-SA 3.0 |
Improved title, because the question is specifically about returning lambdas; added function tag
|
| Jun 17, 2016 at 23:40 | answer | added | Anthony Hall | timeline score: 32 | |
| Dec 18, 2011 at 23:46 | history | edited | Xeo | CC BY-SA 3.0 |
edited body; edited tags; edited title
|
| Nov 5, 2011 at 17:27 | answer | added | dzhioev | timeline score: 26 | |
| Feb 16, 2011 at 1:05 | comment | added | Johannes Schaub - litb |
Lambda expressions in general cannot appear in unevaluated operands. So decltype([](){}) or sizeof([]() {}) is ill-formed no matter where you write it.
|
|
| Jan 19, 2011 at 1:43 | comment | added | James McNellis | @GMan: Unless you are using Visual C++ 2010 or a version of g++ released more than about a year ago (or thereabouts). The captureless-lambda implicit conversion to function pointer wasn't added until March 2010 in N3092. | |
| Jan 19, 2011 at 0:44 | answer | added | user534498 | timeline score: 33 | |
| Jan 18, 2011 at 21:15 | comment | added | GManNickG | By the way, if a lambda has an empty capture clause, it can be implicitly convertible to a pointer to function. | |
| Jan 18, 2011 at 21:06 | comment | added | Motti |
IMO your first option won't work since the lambda in the decltype isn't the same as in the function body and therefore has a different type (even if you included the return statement)
|
|
| Jan 18, 2011 at 21:04 | history | edited | Motti |
edited tags
|
|
| Jan 18, 2011 at 18:57 | comment | added | snk_kid | To add what's already been said, stateless lambda functions are convertible to function pointers. | |
| Jan 18, 2011 at 17:44 | vote | accept | Bartosz Milewski | ||
| Jan 18, 2011 at 17:22 | answer | added | Sean | timeline score: 117 | |
| Jan 18, 2011 at 17:01 | history | asked | Bartosz Milewski | CC BY-SA 2.5 |