B
Benny Hill
I have the following:
//-----------------------
typedef std::map<wxString, const void*> MethodMap;
MethodMap mMethods;
const void* hePlugin::GetMethod(const wxString& name) const{
const MethodMap::iterator pos = mMethods.find(name); <== error
if (pos != mMethods.end()){ return pos->second; }
return 0;
}
When I compile this (gcc 3.2.2 on Redhat 9) I get this error for the line
indicated above:
conversion from
`std::_Rb_tree_iterator<std:air<const wxString, const
void*>, const std:air<const wxString, const void*>, const
std:air<const wxString, const void*>*>` to non-scalar type
`std::_Rb_tree_iterator<std:air<const wxString, const
void*>, std:air<const wxString, const void*>, std:air<const wxString,
const void*>*>`
I'm following an example in "The C++ Standard Library: A Tutorial and
Reference" by Josuttis.
I can see that the problem is the missing "const" modifier on the
std:air's but I don't know how to fix it.
Any help?
//-----------------------
typedef std::map<wxString, const void*> MethodMap;
MethodMap mMethods;
const void* hePlugin::GetMethod(const wxString& name) const{
const MethodMap::iterator pos = mMethods.find(name); <== error
if (pos != mMethods.end()){ return pos->second; }
return 0;
}
When I compile this (gcc 3.2.2 on Redhat 9) I get this error for the line
indicated above:
conversion from
`std::_Rb_tree_iterator<std:air<const wxString, const
void*>, const std:air<const wxString, const void*>, const
std:air<const wxString, const void*>*>` to non-scalar type
`std::_Rb_tree_iterator<std:air<const wxString, const
void*>, std:air<const wxString, const void*>, std:air<const wxString,
const void*>*>`
I'm following an example in "The C++ Standard Library: A Tutorial and
Reference" by Josuttis.
I can see that the problem is the missing "const" modifier on the
std:air's but I don't know how to fix it.
Any help?