今天看到有C++這樣寫:
sort(ins.begin(), ins.end(), [](Interval a, Interval b){return a.start < b.start;});
覺得好牛逼啊。
一般是這么寫的。
bool xxx(const A& a, const A& b) {return a.xxx < b.xxx;}
不知道上面那個居然可以,很可能是C++11里面的寫法吧。
今天看到有C++這樣寫:
sort(ins.begin(), ins.end(), [](Interval a, Interval b){return a.start < b.start;});
覺得好牛逼啊。
一般是這么寫的。
bool xxx(const A& a, const A& b) {return a.xxx < b.xxx;}
不知道上面那個居然可以,很可能是C++11里面的寫法吧。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。