Stl Map

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinceone
    New Member
    • Jul 2007
    • 1

    Stl Map

    Dear all,


    i would like to ask about stl map,

    I have a stl map with a key element short data type. is there any method or efficient function to find the free key element in stl map.

    thanks in advance

    regards
    twinceone
  • Darryl
    New Member
    • May 2007
    • 86

    #2
    I don't know what you mean by "free key"?!

    The find() member function can find a key(). The insert() member will insert a key (and value) and return true if it didn't previously exist, if it does exist it won't insert the new key/value and returns false.

    You can use iterators to iterate through the map to find out what has been used, which I guess in turn tells you what's free.

    Comment

    Working...