EDN Admin
Well-known member
Hello,
<pre class="prettyprint" style=" auto higherOrderFunction = [] (int x) <strong style="color:red -> function<int (int)> {
return [x](int y){
return x * y;
};
};[/code]
MSDN says:"<span style="color:#2a2a2a; font-family:Segoe UI,Lucida Grande,Verdana,Arial,Helvetica,sans-serif You can
omit the return type part of a lambda expression if the lambda body contains
a single return statement or the lambda expression does not return a value." <span style="font-size:0.75em; line-height:1.5
So why "-> function<int (int)>" must be specified? <br/>
View the full article
<pre class="prettyprint" style=" auto higherOrderFunction = [] (int x) <strong style="color:red -> function<int (int)> {
return [x](int y){
return x * y;
};
};[/code]
MSDN says:"<span style="color:#2a2a2a; font-family:Segoe UI,Lucida Grande,Verdana,Arial,Helvetica,sans-serif You can
omit the return type part of a lambda expression if the lambda body contains
a single return statement or the lambda expression does not return a value." <span style="font-size:0.75em; line-height:1.5
So why "-> function<int (int)>" must be specified? <br/>
View the full article