Shows how to use xtd::delegate class.
#include <xtd/console>
#include <xtd/delegate>
class test_delegate {
public:
test_delegate() = default;
console::write_line(str);
}
};
auto main()->int {
auto td = test_delegate {};
auto writer = delegate<void(
const ustring& str)> {td, &test_delegate::write};
writer("String to write");
}
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10