Create an object/Native demonstration: Difference between revisions
Content added Content deleted
(Added C++ implementation) |
(Clarified task wording) |
||
Line 1: | Line 1: | ||
{{draft task}} |
{{draft task}} |
||
Create a Hash/Associative Array/Dictionary-like object |
Create a Hash/Associative Array/Dictionary-like object that can be initialized with key/value pairs. The object should behave like a native Hash/Associative Array/Dictionary of the language, but with the following differences: |
||
* No new |
* No new keys can be added; |
||
* Keys cannot be removed; |
|||
* Item cannot be deleted, (but native delete method may used to reset the item's value to default) ; |
|||
* A key can be reset its original initialized value. |
|||
If the language supports '''Magic Methods''', then show how these work. |
|||
=={{header|C++}}== |
=={{header|C++}}== |