bugCERTI - Bugs: bug #37722, Error: std::remove_if does not...

 
 

bug #37722: Error: std::remove_if does not work correctly in windows system.

Submitter:  YongChangShi <shijian>
Submitted:  Mon 12 Nov 2012 02:37:24 PM UTC
   
 
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Software error Status:  Need Info
Privacy:  Public Assigned to:  erk
Open/Closed:  Closed Release:  * 3.4.1
Reproducibility:  Every Time Fixed Release:  * Unknown
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Apr 2015 01:11:48 PM UTC, comment #2: 

Closing it because I lack the feedback info.

Eric NOULARD <erk>
Group administrator
Fri 27 Sep 2013 07:31:24 AM UTC, comment #1: 

What do you mean by

"Error: std::remove_if does not work correctly in windows system."

Does it crash?
Does it fail?

What is "Windows sytems":

Windows XP, 7, 8 ? 32bits/64bits ?
Using which compiler? Which version ?
Visual Studio [Express] 20xx ?

We can't just replace standard C++ code with something else
without strong explanation.

When you provide code modification could you provide it as a patch please.

http://stackoverflow.com/questions/1648595/how-to-create-a-patch-file-on-windows

Eric NOULARD <erk>
Group administrator
Mon 12 Nov 2012 02:37:24 PM UTC, original submission:  

I tried to fixed it.please check.

file:
  Subscribable.cc
function:
  unsubscribe

original:
void
Subscribable::unsubscribe(FederateHandle fed)
{
std::remove_if(subscribers.begin(),
subscribers.end(),
HandleComparator<Subscriber>(fed));
  
}

fixed:
 */
void
Subscribable::unsubscribe(FederateHandle fed)//取消订购
{
/*added by shijian,begin*/
std::list<Subscriber>::iterator i=subscribers.begin();
for(;i!=subscribers.end();)
{
if(i->getHandle()==fed)
{
subscribers.erase(i);
i=subscribers.begin();
if(i==subscribers.end())
{
return;
}

continue;
}
i++;
}
/*added by shijian,end*/
  
}

YongChangShi <shijian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by erk (Posted a comment)
  • -email is unavailable- added by shijian (Submitted the item)
  •  

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-02 erk Open/ClosedOpen Closed
        Fixed Release3.4.1 Unknown
    2013-09-27 erk StatusNone Need Info
        Assigned toNone erk

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code