Re: Debug Assertion Failed! due to the use of ifstream
Quote:
Originally Posted by
2kaud
In calcPayFixes, there are several lines of code like this
Code:
if (cnt <= payDates_.size())
Are you sure this test should be <= and not < as the elements of the vector go from 0 to .size() -1?
To be honnest, I cannot say since the whole code does not come from me. But I still working on this matter.
Re: Debug Assertion Failed! due to the use of ifstream
Quote:
Originally Posted by
2kaud
Possibly because of what I mentioned in my previous post #13.
I tried your advice in post #13 without success.
Re: Debug Assertion Failed! due to the use of ifstream
Quote:
Originally Posted by
eBooster
To be honnest, I cannot say since the whole code does not come from me. But I still working on this matter.
Are you sure that the parameters you are passing to the constructor of s are correct and valid?
Re: Debug Assertion Failed! due to the use of ifstream
Quote:
Originally Posted by
2kaud
Are you sure that the parameters you are passing to the constructor of s are correct and valid?
Yes, I have checked this, but I think it come from the source you said in post #13.
Re: Debug Assertion Failed! due to the use of ifstream
Quote:
Originally Posted by
2kaud
In calcPayFixes, there are several lines of code like this
Code:
if (cnt <= payDates_.size())
Are you sure this test should be <= and not < as the elements of the vector go from 0 to .size() -1?
You were since very close : the bug came from the second line after the one you highlighted.
Quote:
if (cnt <= payDates_.size())
{
if (cnt + payFrequency_ < payDates_.size()) //< instead of <=
Re: Debug Assertion Failed! due to the use of ifstream
I'm pleased you found the issue. I'm always very wary when I see <= relating to elements of a container.