Shows how to use xtd::collections::generic::list::convert_all method.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
auto lpf = list<drawing::point_f> {};
lpf.add(drawing::point_f {27.8f, 32.62f});
lpf.add(drawing::point_f {99.3f, 147.273f});
lpf.add(drawing::point_f {7.5f, 1412.2f});
console::write_line();
for (const auto& p : lpf)
console::write_line(p);
list<drawing::point> lp = lpf.convert_all<drawing::point>(converter<drawing::point, const drawing::point_f&> {point_f_to_point});
console::write_line();
for (const auto& p : lp)
console::write_line(p);
}
static drawing::point point_f_to_point(const drawing::point_f& pf) {
return {as<int>(pf.x), as<int>(pf.y)};
}
};
#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