Shows how to use hashtable alias.
#include <xtd/collections/hashtable>
#include <xtd/console>
auto main() -> int {
open_with["txt"] = "notepad.exe";
open_with["bmp"] = "paint.exe";
open_with["dib"] = "paint.exe";
open_with["rtf"] = "wordpad.exe";
console::write_line("For key = \"rtf\", value = {0}.", open_with["rtf"]);
open_with["rtf"] = "winword.exe";
console::write_line("For key = \"rtf\", value = {0}.", open_with["rtf"]);
open_with["doc"] = "winword.exe";
open_with["ht"] = "hypertrm.exe";
console::write_line("Value added for key = \"ht\": {0}", open_with["ht"]);
}
console::write_line();
for (auto de : open_with)
console::write_line("Key = {0}, Value = {1}", de.first, de.second);
console::write_line("\nerase(\"doc\")");
console::write_line("Key \"doc\" is not found.");
}
Represents a collection of keys and values.
Definition dictionary.hpp:67
iterator erase(const_iterator pos)
Erases elements.
Definition dictionary.hpp:938
bool contains(const key_t &key) const noexcept
Checks if the container contains element with specific key.
Definition dictionary.hpp:795
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10