Func<List<int>, int> GetVirtualCode = null; // 递归不能直接=,要赋初值。微软得优化啊,这语法糖不够甜 GetVirtualCode = delegate(List<int> args) { if (args.Count == 0) return 0; if (args.Count == 1) return args[0]; return args[0] | GetVirtualCode(args.Skip(1).ToList()); };
c# 匿名委托递归
猜你喜欢
转载自www.cnblogs.com/nanfei/p/10923287.html
今日推荐
周排行