[英]error: no matching function for call to 'copy'
wxString P::getParentPath(const wxString &ss){
wxString dst;
for(wxString::const_iterator it=ss.end();it!=ss.begin();it--)
if(*it=='\\'){
std::copy(ss.begin(),ss.end()-it,dst.begin());
break;
}
return s;
}
error: no matching function for call to 'copy(wxString::const_iterator, wxString::const_iterator::difference_type, wxString::iterator)'|
我正在嘗試將一部分字符串復制到另一個字符串,嘗試時出現此錯誤。 謝謝你的幫助。
如果要復制從字符串開頭到最后一個\\
所有內容(但不包括最后一個\\
,則it
正好指向您想要的位置,就在要復制的最后一個字符之后。
所以你只需要
std::copy(ss.begin(), it, <something>);
但是<something>
不能為dst.begin()
,因為dst
為空。 您也許可以使用back_inserter(dst)
,但是我認為這不適用於wxString
。
我懷疑你的時候使用更好的SubString
函數wxString
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.