[webkit-dev] Strange Compile Error in HashMap/HashSet

Justin Haygood justin at xiondigital.net
Thu Sep 29 11:20:34 PDT 2005


Apparently, Microsoft Visual C++ 7.1 doesn't like HashMap:

{snip}\JavaScriptCore\kxmlcore\HashMap.h(46) : error C2440: 'specialization' :
cannot convert from 'T1::first_type (__cdecl *)(const T1 &)' to
'KXMLCore::HashMap<Key,Mapped,HashFunctions,KeyTraits,MappedTraits>::KeyType
(__cdecl *)(const
KXMLCore::HashMap<Key,Mapped,HashFunctions,KeyTraits,MappedTraits>::ValueType &)'
        None of the functions with this name in scope match the target type

This error is fired in 2 cases: different calling conventions (not the case here,
both using cdecl) or something I don't particularly understand (something along
the lines like casting from a TemplateType<Bla> to a TemplateType).

Any clues as to what its not liking?

Relevant code:

 private:
    typedef HashTable<KeyType, ValueType, extractFirst<ValueType>, HashFunctions,
ValueTraits> ImplType;

I highly believe its the extractFirst<ValueType> that's causing the failure,
which is defined as:

template<typename PairType> 
inline typename PairType::first_type extractFirst(const PairType& value)
{
    return value.first;
}

Thanks,
Justin Haygood



More information about the webkit-dev mailing list