#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
auto main() -> int {
auto ptr =
static_cast<int*
>(
nullptr);
console::out << string::format(
"{}",
ptr) << environment::new_line;
console::out << string::format(
"0x{:x}",
ptr) << environment::new_line;
console::out << string::format(
"{}", *
ptr) << environment::new_line;
console::out << string::format(
"{}",
sptr) << environment::new_line;
sptr = new_sptr<int>(42);
console::out << string::format(
"0x{:x}",
sptr) << environment::new_line;
console::out << string::format(
"{}", *
sptr) << environment::new_line;
console::out << string::format(
"{}",
uptr) << environment::new_line;
uptr = new_uptr<int>(42);
console::out << string::format(
"0x{:x}",
uptr) << environment::new_line;
console::out << string::format(
"{}", *
uptr) << environment::new_line;
}
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10