Ticket #10326

nodecontainer.h バグ報告
Open Date: 2007-04-24 17:31 Last Update: 2007-04-24 17:31

Reporter:
(Anonymous)
Owner:
(None)
Type:
Status:
Open
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
None

Details

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

Edit

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