Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:40:17+00:00 2026-06-17T16:40:17+00:00

I have issues to iterate map when i use map.equal_range() ..my compiler says there

  • 0

I have issues to iterate map when i use map.equal_range() ..my compiler says there is no
no match for ‘operator=’ in ‘s_it = Krange.std::pair<> and no match for ‘operator != ‘??
I am confused and cannot figure out why
following is piece of my code

void Pdb2Cluster_test
(
    multimap <string, unsigned> & pigAccmap,
    multimap <unsigned, proteininfo> & map2
)
{
    // CArgs args = GetArgs();
    //AnsiString v = diff_b;
    multimap<string , unsigned>::iterator imp;

    multimap<string,proteininfo>::iterator s_it;
    multimap<string, pdbbinfo>::iterator ip;
    // set<string>::iterator idp;
    unsigned pig_b;
    int start, stop;
    // int mststar, mstto;
    unsigned cluster, domgi;
    string pdb_ele;


    pdb_ele = "3ST9A";

    imp = pigAccmap.find(pdb_ele);
    if (imp != pigAccmap.end())
    {    pig_b = imp->second;

        std::pair<multimap<unsigned, proteininfo>::iterator, multimap<unsigned,proteininfo>::iterator> Krange;
        Krange  = map2.equal_range(pig_b);
        for (s_it = Krange.first; s_it != Krange.second; s_it++)
        {
            domgi= s_it->second.domgi;
            start= s_it->second.seqstar;
            stop= s_it->second.seqstop;
            cout<<"\t"<<cluster<<"\t"<<pdb_ele<<"\t" <<pig_b<<"\t"<<domgi<<"\t"<<start<<"\t"<<stop<<endl;
            //   myfile<<cluster<<"\t"<<pdb_ele<<"\t" <<domgi<<"\t"<<start<<"\t"<<stop<<endl;

        }
        imp++;
    }
}

I only need to iterator the 2nd multimap so ignore the map.find() for the 1st loop
I referred http://www.cplusplus.com/reference/map/multimap/equal_range/….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:40:18+00:00Added an answer on June 17, 2026 at 4:40 pm

    The type of map2 is std::multimap<unsigned, proteininfo>.

    The type of s_it is std::multimap<std::string, proteininfo>::iterator.

    These don’t match up.

    You might save some trouble by using some typedefs, like

    typedef std::multimap<std::string, proteininfo> protein_map_type;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to do it? I often have issues that work locally
I have a test which fails intermittently because of ordering issues when I iterate
I have issues with Firefox and keydown function. It will not trigger the function
I have issues with .NET CF 3.5 application on Windows Mobile 6.5 on Motorola
I have issues with NSUserDefaults and I don't quite understand what is going on.
We have issues within an application using a state machine. The application is implemented
I still have issues reading UML diagrams. Just looking at the Builder pattern http://en.wikipedia.org/wiki/Builder_pattern
I'm implementing a new template for a Magento site. I have issues with categories
I have two issues in this google chart. I want to either get rid
I have some issues in setting the classpath for the a project for which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.