File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,10 @@ trait CGenFunctions extends CGenEffect with BaseGenFunctions {
346
346
val IR : FunctionsExp
347
347
import IR ._
348
348
349
- // Nested functions are not allowed in standard C.
350
- // TODO: Either emit the function other place or use C++11 (or only gcc)
351
- /*
349
+ // Case for functions with a single argument (therefore, not tupled)
352
350
override def emitNode (sym : Sym [Any ], rhs : Def [Any ]) = rhs match {
353
351
case e@ Lambda (fun, x, y) =>
354
- stream.println(remap(y.tp)+" "+quote(sym)+"("+remap(x.tp)+" "+quote(x)+") {")
352
+ stream.println(" auto " + quote(sym)+ " = [&] (" + remap(x.tp)+ " " + quote(x)+ " ) {" )
355
353
emitBlock(y)
356
354
val z = getBlockResult(y)
357
355
if (remap(z.tp) != " void" )
@@ -361,7 +359,7 @@ trait CGenFunctions extends CGenEffect with BaseGenFunctions {
361
359
emitValDef(sym, quote(fun) + " (" + quote(arg) + " )" )
362
360
case _ => super .emitNode(sym, rhs)
363
361
}
364
- */
362
+
365
363
}
366
364
367
365
trait CGenTupledFunctions extends CGenFunctions with GenericGenUnboxedTupleAccess {
You can’t perform that action at this time.
0 commit comments