xtd 0.2.0
from.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "enumerable.hpp"
6
8namespace xtd {
10 namespace linq {
27 template<class collection_t>
28 const auto& from(const collection_t& source) noexcept {
29 return enumerable::as_enumerable(source);
30 }
32 template<class input_iterator_t>
33 const auto& from(input_iterator_t first, input_iterator_t last) noexcept {
34 return enumerable::as_enumerable(first, last);
35 }
36 template<class source_t>
38 return enumerable::as_enumerable(source);
39 }
40 template<class source_t>
41 const xtd::collections::generic::ienumerable<source_t>& from(const std::initializer_list<source_t>& source) noexcept{
42 return enumerable::as_enumerable(source);
43 }
44 template<class input_iterator_t>
45 const auto& from(input_iterator_t iterator, size_t length) noexcept {
46 return enumerable::as_enumerable(iterator, iterator + length);
47 }
48 template<class source_t, size_t length>
49 const auto& from(const source_t (&array)[length]) noexcept {
50 return enumerable::as_enumerable(array, array + length);
51 }
53 }
54}
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
static const ienumerable< source_t > & as_enumerable(const ienumerable< source_t > &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:235
const auto & from(const collection_t &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition from.hpp:28
Contains xtd::linq::enumerable <type_t> class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10