获取迭代器返回的字符串的大小()

Sac*_*Gax 3 c++ visual-c++

vector<string> frame(const vector<string>& v){
   vector<string> ret;
   string::size_type maxlen = width(v);
   string border(maxlen + 4,'*');

   //write the top border
   ret.push_back(border);

  //write each interior row
  for(vector<string>::const_iterator i = v.begin();i != v.end();++i){
     ret.push_back("* " + *i + string(maxlen- (*i.size()),' ') + " *");
  }

  //write the bottom border
  ret.push_back(border);

  return ret;
 }
Run Code Online (Sandbox Code Playgroud)

在for循环中,我在访问迭代器返回的字符串的size()成员函数时遇到错误i ---->*i.size();

"class"std :: _ Vector_const_iterator >>"没有成员"大小"

not*_*row 7

(*i).size().该.运营商的优先级高于*