I keep getting "vector iterators incompatible" for executing following code:
Tag Som::UpdateAfterTagMessageExciter(string detectedTagID, unsigned char ReaderID, unsigned char antData, SSensors Sensors,bool staff, int BatLevel, int RSSI, int temperature)
{
        tagsIT = search (m_DetectedTags.begin(), m_DetectedTags.end(), searchTag,              
                             searchTag+1,TagCollection::SearchTagsCollByTagIDPredicate);
        if (tagsIT<m_DetectedTags.end())
        {
                 //do something
        }
the SearchTagsCollByTagIDPredicate is as following:
static bool SearchTagsCollByTagIDPredicate (Tag i, string tagID) 
     {
        string secondTag=  i.GetTagID();
        return (tagID==secondTag);
      }
Where m_DetectedTags vector is not used outside this block. The function is being called repeatedly each time a tag is detected by LF antenna. It happens right in the call to search. I tried debugging but to no avail.
I tried replacing the search with a simple for loop and it still doesn't work.
Any ideas why the search is causing the error? Thanks!
 
     
    