fork download
  1. import std.stdio;
  2.  
  3. void main() {
  4. string values[string];
  5. values["hello"] = "world";
  6.  
  7. writeln("Before clearing:");
  8. foreach (k,v; values) {
  9. writefln("[%s] = %s", k, v);
  10. }
  11.  
  12. string[string] empty;
  13. values = empty;
  14.  
  15. writeln("After clearing:");
  16. foreach (k,v; values) {
  17. writefln("[%s] = %s", k, v);
  18. }
  19. }
Success #stdin #stdout 0.01s 2076KB
stdin
Standard input is empty
stdout
Before clearing:
[hello] = world
After clearing: