xtd 0.2.0
format_nullptr.cpp

Show how to use format xtd::format class with null pointers.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/format>
using namespace xtd;
auto main() -> int {
console::out << format("{}", std::nullptr_t {}) << environment::new_line;
}
// This code produces the following output :
//
// null
// null
// null
// null
// 0
// 0
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
xtd::string format(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:20
null_ptr null
Represents a null pointer value.
std::nullptr_t null_ptr
Represents the null_opt alias on std::nullptr_t.
Definition null_ptr.hpp:19
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8