First I should state this program has been running for 3 years just fine and I am not sure what the reason is for it suddenly not working. I just got the new version of MSVC and installed the new BOOST so maybe that's the issue.
Any how, I have 2 vector stucts of mostly strings that I am trying to merge together using the meter number. The meter number can contain a mixture of characters, however they are sorted by SQL ASC before being put in the struct.
Example of the order:
S6642
10172
10296
10322
10804
10884-S
10923
Here is the code that was working but is now giving me the error that the sequence is not ordered. The error is with the lower_bound.
Any help would be great. Thanks!Code:struct UT550_LESS { bool operator () (const UT550AP& lhs , const UT550AP& rhs) { return lhs.sMeterNumber < rhs.sMeterNumber; } }; .... //Loop List for (_vec = m_vecUT553AP.begin(); _vec != m_vecUT553AP.end(); _vec++) { if((*_vec).sMeterNumber != "") { lm_tmp.sMeterNumber = (*_vec).sMeterNumber; //--------------- PROBLEM BELOW --------------- it = lower_bound(m_vecUT550AP.begin(), m_vecUT550AP.end(), lm_tmp, UT550_LESS()); if (it != m_vecUT550AP.end() && (*it).sMeterNumber == (*_vec).sMeterNumber) {




Reply With Quote