Anonymous user
Create an object/Native demonstration: Difference between revisions
Create an object/Native demonstration (view source)
Revision as of 13:12, 20 June 2014
, 9 years agoUpdated D entry
(→{{header|Ruby}}: {{works with|Ruby|1.9}} for KeyError) |
(Updated D entry) |
||
Line 13:
TV[TK] standard, current;
this(TV[TK] default_) pure /*nothrow*/ @safe {
this.standard = default_;
this.current = default_.dup;
Line 24:
}
void clear()
current = standard.dup;
}
Line 31:
void main() {
import std.stdio;
auto d =
d["a"] = 55; d["b"] = 66;
d.clear
d["a"] = 55; d["b"] = 66;
d.remove("a");
}</lang>
{{out}}
|