けっこう便利 公開メンバ変数検索用 template <class Iterator, class Target, class Type, class ClassName> inline Iterator mem_find(Iterator first, Iterator last, const Target& target, Type ClassName::*member) { while (first != last) { if ((*first).*member == target) break; ++first; } return first; } 使い方 ↓↓↓↓↓↓↓↓ struct hoge { string name_; int age_; hoge(const string& name, int age) : name_(name), age_(age) {} }; in