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 678175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:07:15+00:00 2026-05-14T01:07:15+00:00

How do I fix this error? error C2668: ‘std::_Tree<_Traits>::end’ : ambiguous call to overloaded

  • 0

How do I fix this error?

error C2668: ‘std::_Tree<_Traits>::end’ : ambiguous call to overloaded function

My code looks like this:

typedef map<int const *, float> my_map_t;
my_map_t _test;
my_map_t::const_iterator not_found = my_map_t::end();
if (_test.find(&iKeyValue) == not_found) {
    _test[iKeyValue] = 4 + 5; // not the actual code, but here for simplicity
}

The compiler complains that there’s an ambiguous call to my_map_t::end(). This makes sense, because the only difference is the return type.

Normally you can disambiguate the call by casting the parameters, but end() has no parameters. Any ideas?

  • 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-05-14T01:07:15+00:00Added an answer on May 14, 2026 at 1:07 am

    From your code, it appears that my_map_t::end() is static (otherwise you’d have to call it on an instance, e.g. _test.end()). Edit: Jesse Beder is right in his comment to the question; the code doesn’t make much sense, since _test is a type, not an object.

    Static member functions cannot be const-qualified (the const-qualification of a member function applies to the this pointer; static member functions have no this pointer).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would you fix this code? template <typename T> void closed_range(T begin, T end)
How can I fix this error without redundant code? public Comparison2(decimal number1, decimal number2)
How can I fix this error, and install thin or other gems? $ sudo
What causes this error, how can I fix it? Detailed Error Information Module IIS
I know what this error is, how to fix it, etc. My question is
This sure seems like a simple error to fix. However, I somehow can't figure
how can I fix this error ? Target of assignment must be a reference
I was trying to fix this error and I ended up with a new
I keep getting this error. Should I just make id a field? My code
I don't really know XSL but I need to fix this code, I have

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.