[c++] boost::lambda
ちょっと使ってみたけどスゴいねこれ。スゴすぎてちょっと引く。
... typedef struct employee{ string no; double weight; double height; } employee; vector<employee> employees; ... sort(employees.begin(), employees.end(), bind(&employee::height, _1) < bind(&employee::height, _2));
とかできちゃう。ここまでくると、中で何がおこなわれているかは皆目見当もつかない。恐るべしテンプレート。
しかしlambda式の中ではstd::endlをstatic_cast