Skip to content

Commit 4888380

Browse files
committed
added auto return type deduction option for tupled functions
1 parent 54cad86 commit 4888380

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/Functions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ trait CGenTupledFunctions extends CGenFunctions with GenericGenUnboxedTupleAcces
378378
override def emitNode(sym: Sym[Any], rhs: Def[Any]) = rhs match {
379379
case Lambda(fun, UnboxedTuple(xs), y) =>
380380
val retType = remap(getBlockResult(y).tp)
381-
stream.println("function<"+retType+"("+
382-
xs.map(s=>remap(s.tp)).mkString(",")+")> "+quote(sym)+
381+
val retTp = if (cppExplicitFunRet == "true") "function<"+retType+"("+xs.map(s=>remap(s.tp)).mkString(",")+")>" else "auto"
382+
stream.println(retTp+" "+quote(sym)+
383383
" = [&]("+xs.map(s=>remap(s.tp)+" "+quote(s)).mkString(",")+") {")
384384
emitBlock(y)
385385
val z = getBlockResult(y)

0 commit comments

Comments
 (0)