神啊,C 终于开始支持 closure 了
不支持 closure 的语言用起来真是太难受了。
前段时间有同事在用 boost 的时候想用一个匿名的 struct 实现一个 functor 模拟出 closure 来用。可耻的失败鸟。迎接他的是一大坨的 template 编译错误。我这个久久不碰 C++ 的碰观者就有机会在一旁幸灾乐祸了。固然这是因为对 C++ 语言的犄角旮旯认识不足导致的,若是早几年,说不定我还拿这个作为招聘的高级笔试题呢。现在,我只会指责,语言怎么可以设计成这样。
给语言加新特性并不可怕。因为我们最终是要用语言解决问题的。
Apple 给 C/C++ 加的 Blocks 扩展就是这么一个好东西。
Comments
Posted by: sword007 | (30) November 18, 2009 02:35 AM
Posted by: sandy_zc_1 | (29) November 17, 2009 05:26 PM
Posted by: Edison | (28) November 10, 2009 10:02 AM
Posted by: lichking | (27) November 3, 2009 10:37 AM
Posted by: 小x | (26) October 30, 2009 08:44 PM
Posted by: chaussures nike | (25) October 27, 2009 02:30 PM
Posted by: chaussures nike | (24) October 27, 2009 02:30 PM
Posted by: chaussures nike | (23) October 26, 2009 02:23 PM
Posted by: chaussures nike | (22) October 26, 2009 02:23 PM
Posted by: lichking | (21) October 26, 2009 01:14 PM
Posted by: 驾照考试 | (20) October 25, 2009 01:23 AM
Posted by: JiChong | (19) October 23, 2009 09:28 AM
Posted by: 盒子 | (18) October 21, 2009 05:46 PM
Posted by: JiChong | (17) October 21, 2009 11:32 AM
Posted by: Cloud | (16) October 21, 2009 10:56 AM
Posted by: 雷勇 | (15) October 21, 2009 09:05 AM
Posted by: 装配脑袋 | (14) October 20, 2009 08:40 PM
Posted by: lihuiba | (13) October 20, 2009 08:38 AM
Posted by: Zhongxing Xu | (12) October 19, 2009 01:14 PM
Posted by: chu | (11) October 19, 2009 09:39 AM
Posted by: Zhongxing Xu | (10) October 17, 2009 02:36 PM
Posted by: 开心果 | (9) October 17, 2009 01:28 PM
Posted by: Don | (8) October 17, 2009 09:42 AM
Posted by: Anonymous | (7) October 16, 2009 10:12 PM
Posted by: sjinny | (6) October 16, 2009 09:00 PM
Posted by: fenix124 | (5) October 16, 2009 05:27 PM
Posted by: Anonymous | (4) October 16, 2009 05:13 PM
Posted by: breitling | (3) October 16, 2009 03:17 PM
Posted by: chu | (2) October 16, 2009 02:13 PM
Posted by: chu | (1) October 16, 2009 02:08 PM