c++ - Not the address I want content? -


i'm getting more , more confused wasting more time on code. want content of iterator, not address. here code:

peptides temppep; temppep.set_peptide("aabf"); std::vector<peptides>::iterator itpep = std::find_if (this->get_peplist().begin(), this->get_peplist().end(),boost::bind(&peptides::peptide_comparison, _1,temppep));  if (itpep != this->get_peplist().end())  {     spectra tempsp;    tempsp.set_charge(1127);    tempsp.set_snum(1);    std::cout << "without iterator "<< this->get_peplist()[0].get_new_s_num() << std::endl;     // output -> 0    std::cout << "with iterator" << itpep->get_new_s_num() <<std::endl;    //output -> 1129859637 } 

try changing code following:

std::vector<peptides> p = this->get_peplist(); std::vector<peptides>::iterator itpep = std::find_if (p.begin(),     p.end(),boost::bind(&peptides::peptide_comparison, _1,temppep));  

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -