码迷,mamicode.com
首页 > 其他好文 > 详细

lambda 怎么传递ref参数

时间:2017-02-02 14:47:34      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:bug   参数   blog   border   并且   div   int   color   ott   

lambda 传递ref参数有个语法bug,必须要显式书写参数类型。

//
delegate bool FuncType(ref int num);

FuncType func1;
func1 = num => true; //
func1 = (ref num) => true;//
func1 = (ref int num) => true;//ok

//并且,当一个参数书写类型,其他参数也要书写,总之很烦。

lambda 怎么传递ref参数

标签:bug   参数   blog   border   并且   div   int   color   ott   

原文地址:http://www.cnblogs.com/Nobel/p/6361145.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!