Z
zhxzhx
Here is a program, I want to change the way which a map use to order
elements.
struct sizemore
{
bool operator()(const wstring &s1,const wstring &s2)
{
return s1.size()>s2.size();
}
};
int dictinput(const char *filename,map<wstring,wstring> &mwdict())
{
...
}
int main()
{
map<wstring,wstring> mwdict(sizemore());
dictinput("filename",mwdict);
}
But I receive a message:
error C2664: 'dictinput' : cannot convert parameter 2 from
'std::map<_Kty,_Ty> (__cdecl *)(sizemore (__cdecl *)(void))' to
'std::map<_Kty,_Ty> &(__cdecl *)(void)'
I'm always puzzled with parameters of function.
Could some one give me some advices?
Thanks a lot.
elements.
struct sizemore
{
bool operator()(const wstring &s1,const wstring &s2)
{
return s1.size()>s2.size();
}
};
int dictinput(const char *filename,map<wstring,wstring> &mwdict())
{
...
}
int main()
{
map<wstring,wstring> mwdict(sizemore());
dictinput("filename",mwdict);
}
But I receive a message:
error C2664: 'dictinput' : cannot convert parameter 2 from
'std::map<_Kty,_Ty> (__cdecl *)(sizemore (__cdecl *)(void))' to
'std::map<_Kty,_Ty> &(__cdecl *)(void)'
I'm always puzzled with parameters of function.
Could some one give me some advices?
Thanks a lot.