C++ Ambiguous call to Overloaded Function (const variety)
- by Joe
After researching this online, I've only found solutions that don't apply to my problem, so please bear with me. Code snippet:
typedef my_map_t<int const *, float> _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.
Output:
error C2668: 'std::_Tree<_Traits>::end' : ambiguous call to overloaded function
Normally you can disambiguate the call by casting the parameters, but end() has no parameters. Any ideas?