joeGrammar
Programmer
Notice this bit of template code:
#include <map>
#include <algorithm>
template<class K, class V>
class LookupList : public map<K,V>
{
public:
typedef map<K,V> map_type;
public:
LookupList(const V& v) : vDefault(v) {};
~LookupList() {};
bool AddPair( const K& k, const V& v ) {
return map<K,V>::insert(make_pair<const K, V>(k,v)).second;
};
{ FYI Here is the code for insert from <map>
_Pairib insert(const value_type& _X)
{_Imp::_Pairib _Ans = _Tr.insert(_X);
return (_Pairib(_Ans.first, _Ans.second)); }
}
I'm getting errors on the make_pair function:
error C2667: 'make_pair' : none of 2 overload have a best conversion
error C2668: 'make_pair' : ambiguous call to overloaded function
In the file, the make_pair variable is declared in the std namespace like so..:
using std::make_pair;
Now I haven't worked with make_pair before and I don't know where it comes from, I'm assuming its making an ordered pair. My question is where is the code for make_pair and why am I getting these error messages, the code itself looks fine unless make_pair itself can't handle these types of template parameters... any thoughts?
Thanks
#include <map>
#include <algorithm>
template<class K, class V>
class LookupList : public map<K,V>
{
public:
typedef map<K,V> map_type;
public:
LookupList(const V& v) : vDefault(v) {};
~LookupList() {};
bool AddPair( const K& k, const V& v ) {
return map<K,V>::insert(make_pair<const K, V>(k,v)).second;
};
{ FYI Here is the code for insert from <map>
_Pairib insert(const value_type& _X)
{_Imp::_Pairib _Ans = _Tr.insert(_X);
return (_Pairib(_Ans.first, _Ans.second)); }
}
I'm getting errors on the make_pair function:
error C2667: 'make_pair' : none of 2 overload have a best conversion
error C2668: 'make_pair' : ambiguous call to overloaded function
In the file, the make_pair variable is declared in the std namespace like so..:
using std::make_pair;
Now I haven't worked with make_pair before and I don't know where it comes from, I'm assuming its making an ordered pair. My question is where is the code for make_pair and why am I getting these error messages, the code itself looks fine unless make_pair itself can't handle these types of template parameters... any thoughts?
Thanks