This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
In my opinion, lambdas are not intended as just a shortcut to writing a function object class. This is why our proposal did not require that lambdas be implemented as classes; it is simply one implementation. (Awaiting word to see if this is still the case in the working draft of the standard; it may not be, but that doesn't change my opinion :)
Thus, users should never see the class name. In warnings and errors, a lambda should be treated like an anonymous class, swapping its compiler-generated name with a placeholder like <lambda function> (similar to <anonymous class>).
Since templates work so differently from normal functions, I'm a little uncomfortable with the idea of templates that don't involve any template syntax, just the use of auto in the parameter list. But I'm open to giving it a try, at least in the lambda context. Maybe outside of lambda it could be used with a small template introducer...
In response to Jason's concern here, a template implementation is not required, just convenient. Hopefully you won't think of it as "templates without template syntax", but "deduction using the existing template mechanism".
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |