If I want the unordered map find function to return a bool value, how would I go about doing that?
Here’s my code right now.
bool NS_SymbolTable::SymbolTable::Contains(std::string lexeme)
{
SymbolTable *tempSymbolTable = this;
std::unordered_map<std::string, Identifier*>::iterator it = tempSymbolTable->hashtable.find(lexeme);
return std::boolalpha;
}
What else do I neeed to do ? Is it possible to return a bool? There is little to no documentation on this that I have found.
This is where I got an example from http://msdn.microsoft.com/en-us/library/bb982431.aspx
For documentation look std::unordered_map::find. There it says:
To get boolean value indicating whether an element is present, use