xtd 0.2.0
Loading...
Searching...
No Matches
to_list_view.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#define __XTD_STD_INTERNAL__
8#undef __XTD_STD_INTERNAL__
10#include "../../istringable.hpp"
11#include "../../string.hpp"
12#include "../../views/views.hpp"
13
15#if defined(__xtd__cpp_lib_ranges)
17#include <ranges>
18
20namespace xtd {
22 namespace ranges {
24 namespace views {
45 public:
47
52 template <std::ranges::range range_t>
53 auto operator()(range_t&& source) const {return xtd::linq::enumerable::from(std::forward<range_t>(source)).to_list();}
54
66 template <std::ranges::range range_t>
67 friend auto operator |(range_t&& source, const to_list_view& view) {return view(std::forward<range_t>(source));}
69 };
70 }
71 }
72}
74#endif
static const auto & from(const ienumerable< source_t > &source) noexcept
Returns the input typed as xtd::collections::generic::ienumerable <type_t>.
Definition enumerable.hpp:694
The xtd::ranges::views::to_list_view class is used to convert a sequence to a list.
Definition to_list_view.hpp:44
friend auto operator|(range_t &&source, const to_list_view &view)
Applies a filter on the given range using the pipe operator.
Definition to_list_view.hpp:67
auto operator()(range_t &&source) const
Converts a sequence of values to a list.
Definition to_list_view.hpp:53
Contains xtd::istringable interface.
Contains xtd::linq::enumerable <type_t> class.
The view namesapce contains range views, lightweight objects that indirectly represent iterable seque...
Definition distinct.hpp:20
The ranges namespace is an extension and generalization of the xtd::linq that makes them more powerfu...
Definition distinct.hpp:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::string alias.
Contains xtd::views alias namespace.