Logo

Programming-Idioms

  • Pascal
  • Rust
  • Java
  • Ruby

Idiom #331 Clear map

Remove all entries from the map m.

Explain if other references to the same map now see an empty map as well.

m.clear

The hash is cleared for all references
fgl (or generics.collections)
m.clear;

Other references to the same map now see an empty map as well.
m.clear();

All references to this map now see an empty map.
m.Clear();

All references see it's empty.

New implementation...
< >
programming-idioms.org