摘要: 0. C++11 compiler support shootouthttp://cpprocks.com/c11-compiler-support-shootout-visual-studio-gcc-clang-intel/http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx1. Important Minor Syntax Cleanups//Spaces in Template Expressionsstd::vector>;//nullptr and std::nullptr_tf(0); //calls f 阅读全文
posted @ 2013-10-19 16:18 LambdaTea 阅读(387) 评论(0) 推荐(0) 编辑
摘要: /* range.js */function range(from, to) { var r = inherit(range.methods); r.from = from; r.to = to; return r;}range.methods = { includes: function(x) { return this.from <= x && x <= this.to; }, foreach: function(f) { for (var x=Math.ceil(this.from); x<=this.to; x++)... 阅读全文
posted @ 2013-10-19 15:42 LambdaTea 阅读(184) 评论(0) 推荐(0) 编辑
摘要: var strict = (function() { return !this;}());//function getPropertyNames(o, /* optional */ a) { if (a === undefined) a = []; /* a = a || [] */ for(var property in o) { a.push(property); } return a;}/* callee 当前正在执行的函数, caller 当前正在执行的函数的函数 *///var scope = "global scope";function... 阅读全文
posted @ 2013-10-19 15:05 LambdaTea 阅读(175) 评论(0) 推荐(0) 编辑
摘要: /* array */var empty = [];var primes = [2,3,5];var misc = [1.1, true, "a"];//var a = new Array(10);//a = [1,2,3];Object.defineProperty(a, "length", {writable: false});a.length = 0; //a will not changevar keys = Object.keys(o); //获得o对象属性名组成的数组var values = [];for(var i = 0; i<ke 阅读全文
posted @ 2013-10-19 14:39 LambdaTea 阅读(126) 评论(0) 推荐(0) 编辑