Contains linq definitions.
◆ from()
template<class collection_t>
auto xtd::linq::from |
( |
collection_t && | source | ) |
|
|
noexcept |
#include <xtd.core/include/xtd/linq/from.hpp>
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
- Parameters
-
source | A sequence of values. |
- Returns
- The input sequence typed as xtd::collections::generic::ienumerable <type_t>.
- Header
-
- Namespace
- xtd::linq
- Library
- xtd.core
- Examples
- The following code example demonstrates how to use xtd::linq::from to create a sequence of values.
#include <xtd/xtd>
auto main() -> int {
auto items = std::vector {"One", "Two", "Three", "Four", "Five"};
const auto& enumerable = from(items);
auto enumerator = enumerable.get_enumerator();
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
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
- See also
- xtd::linq::enumerable::from methods for all overloads of xtd::linq::from.