xtd 0.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
linq

Definition

Contains linq definitions.

Classes

class  xtd::linq::enumerable
 Provides a set of static methods for querying objects that implement ienumerable <type_t>. More...
 

Functions

template<class collection_t >
const auto & xtd::linq::from (const collection_t &source) noexcept
 Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
 

Function Documentation

◆ from()

template<class collection_t >
const auto & xtd::linq::from ( const collection_t &  source)
noexcept

#include <xtd.core/include/xtd/linq/from.hpp>

Returns the input typed as xtd::collections::generic::ienumerable <type_t>.

Parameters
sourceA sequence of values.
Returns
The input sequence typed as xtd::collections::generic::ienumerable <type_t>.
Header
#include <xtd/linq/from>
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>
using namespace xtd;
using namespace xtd::linq;
auto main() -> int {
auto items = std::vector {"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
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Provides a set of static methods for querying objects that implement ienumerable <type_t>.
Definition enumerable.hpp:55
const auto & from(const collection_t &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition from.hpp:28
Provides classes and interfaces that support queries that use Language-Integrated Query (LINQ).
Definition enumerable.hpp:38
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
See also
xtd::linq::enumerable::from methods for all overloads of xtd::linq::from.