Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » [FEATURE REQUEST] bool AMap::HasKey(K key) ;
Re: [FEATURE REQUEST] bool AMap::HasKey(K key) ; [message #43139 is a reply to message #43138] Fri, 16 May 2014 11:04 Go to previous message
omari is currently offline  omari
Messages: 276
Registered: March 2010
Experienced Member
Thank you Mirek,

I do not want a replacement of Find ().

usually, i check if the map contains a key or not, in this situation, the position of the key (if exist) does not interest me, then there is a risk of forgetting of (>= 0) (that happened to me twice)

a function (bool Haskey (K k)) seems more natural in this situation.

for example
bool Haskey (K& k){return ++Find(k));}


or

bool Haskey (K& k){return Find (k)>= 0);}




regards
omari.
 
Read Message
Read Message
Read Message
Previous Topic: [FIXED] String::Replace(empty string,) => Out of memory!
Next Topic: Unterminated processing info in XmlParser
Goto Forum:
  


Current Time: Thu Aug 28 16:09:46 CEST 2025

Total time taken to generate the page: 0.06737 seconds