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

Shows how to use xtd::linq::from method.

#include <xtd/xtd>
auto main() -> int {
auto items = array {"One", "Two", "Three", "Four", "Five"};
const auto& enumerable = from(items);
auto enumerator = enumerable.get_enumerator();
while (enumerator.move_next())
console::write_line(enumerator.current());
}
// This code produces the following output :
//
// One
// Two
// Three
// Four
// Five
const type_t & current() const override
Gets the element in the collection at the current position of the enumerator.
Definition enumerator.hpp:62
bool move_next() override
Advances the enumerator to the next element of the collection.
Definition enumerator.hpp:71