On Fri, 2006-11-10 at 14:47 -0800, Mark Mitchell wrote:
> Sohail Somani wrote:
> 
> > struct __some_random_name
> > {
> >     void operator()(int & t){t++;}
> > };
> > 
> > for_each(b,e,__some_random_name());
> > 
> > Would this require a new tree node like LAMBDA_FUNCTION or should the
> > parser do the translation? In the latter case, no new nodes should be
> > necessary (I think).
> 
> Do you need new class types, or just an anonymous FUNCTION_DECL?

Hi Mark, thanks for your reply.

In general it would be a new class. If the lambda function looks like:

void myfunc()
{

int a;

...<>(int i1,int i2) extern (a) {a=i1+i2}...

}

That would be a new class with an int reference (initialized to a) and
operator()(int,int).

Does that clarify?

Sohail

Reply via email to