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

Show how to use format xtd::format class with std::optional.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
#include <optional>
using namespace xtd;
auto main() -> int {
console::out << string::format("{}", std::optional<string>()) << environment::new_line;
console::out << string::format("{}", std::optional<string>("Optional string")) << environment::new_line;
}
// This code produces the following output :
//
// (null)
// (Optional string)
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10