Shows how to use xtd::collections::generic::list::for_each method.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
auto names = list<string> {};
names.add("Bruce");
names.add("Alfred");
names.add("Tim");
names.add("Richard");
names.for_each(action<const string&> {print});
names.for_each(action<const string&> {[](const string& name) {
console::write_line(name);
}});
}
private:
static void print(const string& s) {
console::write_line(s);
}
};
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:168