Timeline for Coalescing lvalue references to std-optionals
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 22, 2019 at 11:24 | comment | added | pacmaninbw♦ | I haven't seen a real programmers statement in decades! Thank you. | |
Dec 21, 2019 at 21:11 | comment | added | einpoklum |
So, in what ways (other than elegance) is @G.Sliepen's answer better? IIANM yours would work with C++14 and and std::experimental::optional , wouldn't it?
|
|
Dec 21, 2019 at 21:08 | comment | added | G. Sliepen |
You can use the trick of @Deduplicator and write using T = std::common_type_t<Ts...> , so you can drop class T from the template arguments, and then use auto return type.
|
|
Dec 21, 2019 at 20:50 | comment | added | Deduplicator | Upvote for making me laugh with "real programmers". There is just one fly in the ointment: You require a manually specified return-type. | |
Dec 21, 2019 at 20:48 | history | answered | user673679 | CC BY-SA 4.0 |