宣佈我從以下一些這方面的信息:How to find the first character in a C++ stringNOT1並沒有在此範圍
當我試圖落實到我的代碼,我得到了錯誤NOT1沒有在這個範圍內聲明。
void ASTree::indent(int ind, int inc) {
std::string theText;
for (std::vector<ASTree*>::const_iterator i = child.begin(); i != child.end(); ++i) {
switch ((*i)->nodeType) {
case category:
(*i)->indent(ind + inc, inc);
break;
case token:
{
//out << std::setw(indent) << " ";
theText = (*i)->text; // << std::endl;
std::string::iterator firstChar = std::find_if(theText.begin(), theText.end(), std::not1(std::isspace));
theText.erase(theText.begin(), firstChar);
(*i)->text = theText;
}
break;
case whitespace:
//out << (*i)->text;
break;
}
}
}
我對C++有點新不熟悉,並且在課上學習這些項目。
那麼,not1在此代碼中沒有任何聲明。你確定你沒有錯過什麼嗎? – juanchopanza