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

Show how to use format xtd::format class with sequence containers.

#include <xtd/collections/array_list>
#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
using namespace xtd;
using namespace xtd::collections;
auto main() -> int {
console::out << string::format("{}", generic::list<int> {1, 2, 3, 4}) << environment::new_line;
console::out << environment::new_line;
console::out << string::format("{}", std::initializer_list<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::array<int, 4> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::forward_list<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::list<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::deque<int> {1, 2, 3, 4}) << environment::new_line;
console::out << string::format("{}", std::vector<int> {1, 2, 3, 4}) << environment::new_line;
}
// This code produces the following output :
//
// [1, 2, 3, 4]
//
// [1, 2, 3, 4]
// [1, 2, 3, 4]
// [1, 2, 3, 4]
// [1, 2, 3, 4]
// [1, 2, 3, 4]
// [1, 2, 3, 4]
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:72
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10