Shows how to use xtd::delegate class.
#include <xtd/console>
#include <xtd/delegate>
void goodbye(const string& s) {
console::write_line("Goodbye {}", s);
}
public:
void hello(const string& s) {
console::write_line("Hello {}", s);
}
};
auto main() -> int {
using example_function = delegate<void(const string&)>;
auto instance = ::object {};
auto str = string {"World"};
auto f = example_function {instance, &::object::hello};
return 0;
}
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10