//1)it will save a lot of typing. typedef vector< pair<int, string> > ComVec; ComVec::value_type aaa; //2)int to float, but below code don’t need change at all. typedef vector< pair<float, string> > ComVec; //3) inside of funciton. typedef std::vector< std::pair<int,std::string> > Record_t; //______________________________________________________________________________
typedef is your good friend, reuse it below Record_t k1; int find_it(std::string value, __________________
Record_t const& stuff){ auto fit = std::find_if(stuff.begin(), stuff.end(), [value](__________________________________________
Record_t::value_type const& vt) -> bool { return vt.second == value; });