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