待辦事項 #10326

nodecontainer.h バグ報告
啟用日期: 2007-04-24 17:31 最後更新: 2007-04-24 17:31

回報者:
(匿名)
負責人:
(無)
類型:
狀態:
開啟
元件:
(無)
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
檔案:

細節

Version 0.5.2

original source
---------------------------------------------
template <class Pred>
typename nodelist_type::iterator search(Pred
pred,int index){
int i = 0;
typename nodelist_type::iterator
it,first,last=getChildren().end();
for (first=getChildren().begin() ; it!=last ;
first=++it,++i )
{
it = std::find_if(first,last,pred);
if( i==index ) break;
}
return it;
}
---------------------------------------------

itの初期化が無いため、落ちていました。

modified source
---------------------------------------------
template <class Pred>
typename nodelist_type::iterator search(Pred
pred,int index){
int i = 0;
typename nodelist_type::iterator
it,first,last=getChildren().end();
first=getChildren().begin();
it = first;
for ( ; it!=last ; first=++it,++i )
{
it = std::find_if(first,last,pred);
if( i==index ) break;
}
return it;
}
---------------------------------------------

Ticket History (0/0 Histories)

Attachment File List

No attachments

編輯

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登入