Shows how to use xtd::delegate::begin_invoke, xtd::delegate::end_invoke and xtd::delegate::invoke methods.
#include <xtd/threading/thread>
#include <xtd/console>
#include <xtd/delegate>
auto main() -> int {
auto d1 = delegate<int(string)> {[](string name) -> int {
console::write_line("(Thread {}) Hello {}!", thread::current_thread().managed_thread_id(), name);
return name == "xtd" ? 42 : 24;
}};
auto result = d1.begin_invoke("Gammasoft");
console::write_line("return = {}", d1.invoke("xtd"));
console::write_line("return = {}", d1.end_invoke(result));
}
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10