See reddit post for some additional context: http://www.reddit.com/r/cpp/comments/2nkcvi/generic_lambda_inconsistency/
An ellipsis following an auto should always be parsed as a parameter pack, not as a c-variadic.
[](auto ...) { }(); // OK.
Differential D6520
Fix PR21684 - Ellipsis at end of generic lambda parameter-declaration-clause should be parsed as a parameter pack faisalv on Dec 3 2014, 8:46 PM. Authored by
Details See reddit post for some additional context: http://www.reddit.com/r/cpp/comments/2nkcvi/generic_lambda_inconsistency/ An ellipsis following an auto should always be parsed as a parameter pack, not as a c-variadic. [](auto ...) { }(); // OK.
Diff Detail Event Timeline
Comment Actions I had a sneaking suspicion the refactoring wouldn't fly - and while I find such singular uses of lambdas adding clarity when used judiciously - I can certainly appreciate your concerns here. Mostly, thanks for articulating your rationale! =) Committed as r223357 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141201/119491.html) per your preference. Thanks! Comment Actions Committed as r223357 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141201/119491.html) per your preference. Thanks! |
Please keep this existing code structure and just add the check for 'auto' to the end, or factor out a meaningful part of this into a separate function. Adding a page full of semi-unrelated code into the middle of a function like this makes it harder to read, and the code communicates its intent well enough without the comments.