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  |
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.
|
|
|
Goto Forum:
Current Time: Sun May 11 15:08:49 CEST 2025
Total time taken to generate the page: 0.00732 seconds
|