By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

release crash

P: n/a
I have a problem with this code when execute it in release.In debug
work and in release crash.
Can somebody help me?

c_it=std::find_if(icset.set.begin(),icset.set.end( ),IsPositive);/*find
first marked*/
if (c_it!=icset.set.end()) n_it=std::find_if(c_it
+1,icset.set.end(),IsNegative);
else n_it=icset.set.end();
while (1) {
if ((c_it==icset.set.end()) || (n_it==icset.set.end())) break;
float ic=(*c_it).p;
float nic=(*n_it).p;
int ii;
if (ic==(int)ic) ii=ic;
else ii=(int) ic+1;
int nii=(int) nic;
char sign=((*c_it).d<0)?1:-1;
if ((*c_it).id<0) sign=!sign;
for (int i=ii;i<=nii;i++)
{
assert(x<nx);
assert(y<ny);
assert(ry<2);
signed_slice[x][i][ry]=sign;
}
c_it=find_if(c_it+1,icset.set.end(),IsPositive);
n_it=find_if(c_it+1,icset.set.end(),IsNegative);
}

Mar 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mar 20, 3:02 pm, "antani" <antani8...@yahoo.itwrote:
I have a problem with this code when execute it in release.In debug
work and in release crash.
Can somebody help me?

c_it=std::find_if(icset.set.begin(),icset.set.end( ),IsPositive);/*find
first marked*/
if (c_it!=icset.set.end()) n_it=std::find_if(c_it
+1,icset.set.end(),IsNegative);
else n_it=icset.set.end();
while (1) {
if ((c_it==icset.set.end()) || (n_it==icset.set.end())) break;
float ic=(*c_it).p;
float nic=(*n_it).p;
int ii;
if (ic==(int)ic) ii=ic;
else ii=(int) ic+1;
int nii=(int) nic;
char sign=((*c_it).d<0)?1:-1;
if ((*c_it).id<0) sign=!sign;
for (int i=ii;i<=nii;i++)
{
assert(x<nx);
assert(y<ny);
assert(ry<2);
signed_slice[x][i][ry]=sign;
}
c_it=find_if(c_it+1,icset.set.end(),IsPositive);
n_it=find_if(c_it+1,icset.set.end(),IsNegative);
}
Not with the code you give. Please provide a *minimal* but *complete*
program that demonstrates your problem (http://www.parashift.com/c++-
faq-lite/how-to-post.html#faq-5.8).

Also consult "Surviving the Release Version" by Joseph M. Newcomer:

http://www.codeproject.com/debug/survivereleasever.asp

Cheers! --M

Mar 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.