2010-07-25から1日間の記事一覧

mem_funの使い方

例えばfor_eachの第3引数ですが、ここは関数オブジェクトを指定します。しかしそれを一々作るのもどうかと思うので、関数があればptr_funで関数オブジェクトを作ってそれを利用します。 #include <iostream> #include <vector> #include <algorithm> using namespace std; void print(int </algorithm></vector></iostream>…