This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [lambda] Segmentation fault in simple lambda program
- From: John Freeman <jfreeman08 at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Adam Butcher <adam at jessamine dot co dot uk>, adam dot butcher at selex-comms dot com, Esben Mose Hansen <kde at mosehansen dot dk>, gcc at gcc dot gnu dot org
- Date: Mon, 03 Aug 2009 23:11:14 -0500
- Subject: Re: [lambda] Segmentation fault in simple lambda program
- References: <1248855585.29221.ezmlm@gcc.gnu.org> <e6d492a86b8db6491722f0c39594123f.squirrel@webmail.plus.net> <4A772D0F.5010804@redhat.com> <a9a4829ad72929478dd6154c750e5534.squirrel@webmail.plus.net> <4A77B130.2080302@redhat.com>
Jason Merrill wrote:
Experimenting with a working version and seeing it's issues will be
useful to me. To others to maybe. With concepts
gone from C++0x and being reworked for C++15(?) maybe support for
polymorphic lambdas could be reintroduced? -- though
I'm sure its much too late for that and that its likely been around
the buoy many times. From what I have read I got
the idea that the Callable concept was the primary reason for
polymorphic lambdas not being accepted.
I don't know what the reasoning was there, but people have been
somewhat conservative about what usages of lambdas are allowed for
fear of unforseen implementation issues. Certainly having a working
implementation would go a lot toward convincing people to allow it,
even if it doesn't make it into C++0x.
There were several issues with polymorphic lambdas in the presence of
concepts that concerned many on the committee. I've come to accept that
it's too late to re-introduce polymorphic lambdas into C++0x (now
C++1x), but there's no stopping GCC from implementing it as an extension.
Implied template typename arguments via auto are not currently
supported. The syntax parses but I haven't yet
synthesized the template arguments and therefore not replaced the
auto's with them so it doesn't compile.
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...
Just my opinion, but I don't think there should be any special template
syntax. The whole point of argument deduction was terseness. It
doesn't have to be implemented using templates, so I don't equate it
with templates.
- John