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
Post a Comment