#include <xtd/console>
#include <xtd/environment>
#include <xtd/iformatable>
public:
explicit foo(int value) : value_ {value} {}
using object::to_string;
string to_string(const string& format, const std::locale& loc) const override {return string::format(string::format("{{:{}}}", format), value_);}
private:
int value_ = 0;
};
auto main() -> int {
auto f = foo {42};
console::out << "standard output :" << environment::new_line;
console::out <<
" " <<
f << environment::new_line;
console::out <<
" " <<
f.to_string() << environment::new_line;
console::out << string::format(" {}", f) << environment::new_line;
console::out << string::format(" 0b{:b8}", f) << environment::new_line;
console::out <<
" 0b" <<
f.to_string(
"b8", std::locale {}) << environment::new_line;
console::write_line();
console::write_line("write_line :");
console::write(" ");
console::write_line(f);
console::write(" ");
console::write_line(
f.to_string());
console::write_line(" {}", f);
console::write_line(" 0b{:b8}", f);
console::write(" 0b");
console::write_line(
f.to_string(
"b8", std::locale {}));
}
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10