Shows how to use xtd::action alias.
#include <xtd/collections/generic/list>
#include <xtd/action>
#include <xtd/console>
#include <algorithm>
auto main() -> int {
auto names =
list {
"Bruce",
"Alfred",
"Tim",
"Richard"};
}};
std::for_each(names.begin(), names.end(),
print);
std::for_each(names.begin(), names.end(), [](const string & value) {
console::write_line(value);
});
}
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
delegate< void(arguments_t...)> action
Represents a xtd::delegate that has variable parameters and does not return a value.
Definition action.hpp:20
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
void print(FILE *file, arg_t &&value)
Writes the text representation of the specified value to the file output stream.
Definition print.hpp:19