xtd 0.2.0
Loading...
Searching...
No Matches
delegate_lambda.cpp

Shows how to use xtd::delegate class.

#include <xtd/console>
#include <xtd/delegate>
#include <xtd/environment>
using namespace xtd;
auto main()->int {
// use delegate as std::function
auto writer = delegate<void(const ustring& str)> {[](const ustring & str) {
console::out << str << environment::new_line;
}};
writer("Value to write");
}
// This code produces the following output:
//
// Hello, World!
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