请C++高手指导 IntelliSense: 缺少 类模板 "std::iterator" 的参数列表 。如何添加类模板到集成环境 50
#include<algorithm>#include<cassert>#include<cstddef>#include<fstream>#include<functi...
#include<algorithm>
#include<cassert>
#include<cstddef>
#include<fstream>
#include<functional>
#include<iterator>
#include<string>
#include<vector>
#include<iostream>
#include"require.h"
using namespace std;
int main(int argc,char* argv[])
{
char* fname="FindBlanks.cpp";
if(argc>1)fname=argv[1];
ifstream in(fname);
assure(in,fname);
vector<string>vs;
string s;
while(getline(in,s))
vs.push_back(s);
vector<string>cpy=vs;
vector<string>;;iterator lsi=find_if(vs.begin(),vs.end(),mem_fun_ref(&string::empty));
while(lsi!=vs.end()){
*lsi="A BLANK LINE";
lsi=find_if(vs.begin(),vs.end(),mem_fun_ref(&string::empty));
}
for(size_t i=0;i<cpy.size();i++)
if(cpy[i].size()==0){
assert(vs[i]=="A BLANK LINE");
cout<<"A BLANK LINE"<<endl;
}
else
assert(vs[i]!="A BLANK LINE");
} 展开
#include<cassert>
#include<cstddef>
#include<fstream>
#include<functional>
#include<iterator>
#include<string>
#include<vector>
#include<iostream>
#include"require.h"
using namespace std;
int main(int argc,char* argv[])
{
char* fname="FindBlanks.cpp";
if(argc>1)fname=argv[1];
ifstream in(fname);
assure(in,fname);
vector<string>vs;
string s;
while(getline(in,s))
vs.push_back(s);
vector<string>cpy=vs;
vector<string>;;iterator lsi=find_if(vs.begin(),vs.end(),mem_fun_ref(&string::empty));
while(lsi!=vs.end()){
*lsi="A BLANK LINE";
lsi=find_if(vs.begin(),vs.end(),mem_fun_ref(&string::empty));
}
for(size_t i=0;i<cpy.size();i++)
if(cpy[i].size()==0){
assert(vs[i]=="A BLANK LINE");
cout<<"A BLANK LINE"<<endl;
}
else
assert(vs[i]!="A BLANK LINE");
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询