xtd 0.2.0
Loading...
Searching...
No Matches
format_unordered_associative_containers.cpp

Show how to use format xtd::format class with unordered associative containers.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
using namespace xtd;
auto main() -> int {
console::out << string::format("{}", std::unordered_set<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::unordered_multiset<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::unordered_map<int, string> {{1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}}) << environment::new_line;
console::out << string::format("{}", std::unordered_multimap<int, string> {{1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}}) << environment::new_line;
}
// This code produces the following output :
//
// {1, 2, 3, 4}
// {1, 2, 3, 4}
// {(1, one), (2, two), (3, three), (4, four)}
// {(1, one), (2, two), (3, three), (4, four)}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10