C++14 introduced generic lambdas. While skimming through the related proposals I found N3418 by Faisal Vali, Herb Sutter and Dave Abrahams. Therein section 2.2 is titled :
2.2 Allow the use of familiar template syntax in lambda expressions
and the following code examples include snippets like this one
[]<int N>(int (&a)[N]) {}
Since such things fail to compile (with gcc, clang and Visual Studio), some questions come up :
- Is this an implementation issue ?
- What stopped this part from being accepted ?
- Which is the proposal that finally brought generic lambdas into the language ?
Note: I would comment on this but don't have the reputation to.
That precise construct that you quote works fine if I compile the following:
with:
However, using
g++-4.8
orclang-3.6
both fail. Therefore, I would assume that it is an implementation issue. However, I am not familiar enough with the C++14 standard to know why/if it was accepted (for instance, g++ 4.9 supporting it may be non-standard).The version of the paper that was accepted was
N3649
, we can see this by going to Evolution Working Group(EWG) Completed Issue 16: N3649, N3560, N3559, N3418 Proposal for Generic (Polymorphic) Lambda Expressions:Note this references proposal
2.1
and2.2
as being NAD(Not A Defect) and that they won't be reopened.N3560
was split off fromN3418
which was the main proposal and proposal2.1
inN3560
was:that paper notes proposal
2.1
was considered controversial:and we can see that N3649 does not contain this proposal my guess from the quote in paper
N3560
:was that auto was considered sufficient in the end which would be consistent with saying that the proposal is
NAD
meaning the issue it attempted to resolve is not really an issue.