M
maverick
Hello
I am trying to write a wrapper for the MFC Cmap
I am trying to write the equivalent of CMap::Lookup ( KEY key , VALUE
&value)
template < class KEY , class VALUE >
class CMap
{
...
...
CMap::Lookup ( KEY key , VALUE &value)
{
typename CMap<KEY , VALUE>::iterarator iter ;
// Need to initialize iterator to a default value , like NULL or 0
iter.find(key);
// if(iter!= DEFAULT VALUE)
{
value = *iter ;
return TRUE ;
}
return FALSE
}
private :
map<KEY , VALUE> m_map ;
} ;
Now I want to set a default value for the iterator , like a NULL or a 0
, so that using "find" I can check the result and set the value .
I would like to know a good place for STL Documentation
Thanks
I am trying to write a wrapper for the MFC Cmap
I am trying to write the equivalent of CMap::Lookup ( KEY key , VALUE
&value)
template < class KEY , class VALUE >
class CMap
{
...
...
CMap::Lookup ( KEY key , VALUE &value)
{
typename CMap<KEY , VALUE>::iterarator iter ;
// Need to initialize iterator to a default value , like NULL or 0
iter.find(key);
// if(iter!= DEFAULT VALUE)
{
value = *iter ;
return TRUE ;
}
return FALSE
}
private :
map<KEY , VALUE> m_map ;
} ;
Now I want to set a default value for the iterator , like a NULL or a 0
, so that using "find" I can check the result and set the value .
I would like to know a good place for STL Documentation
Thanks