xtd 0.2.0
Loading...
Searching...
No Matches
as.hpp
Go to the documentation of this file.
1
3#pragma once
4#include "any.hpp"
6#include "types.hpp"
7#include <memory>
8#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
12#include "convert.hpp"
13#define __XTD_CORE_INTERNAL__
34#undef __XTD_CORE_INTERNAL__
35#include "convert_pointer.hpp"
36#define __XTD_CORE_INTERNAL__
38#undef __XTD_CORE_INTERNAL__
39#include "convert_string.hpp"
40#define __XTD_CORE_INTERNAL__
42#undef __XTD_CORE_INTERNAL__
43#include "any_object.hpp"
44#define __XTD_CORE_INTERNAL__
46#undef __XTD_CORE_INTERNAL__
47#include "linq/enumerable.hpp"
49
51template<typename new_type_t, typename current_type_t>
52new_type_t* __convert_value__(current_type_t* value) {
53 return xtd::as<new_type_t>(value);
54}
55
56template <typename result_t, typename source_t>
58 static thread_local auto result = xtd::linq::enumerable_collection<result_t> {};
60 for (const auto& item : source)
61 result.items.push_back(xtd::as<result_t>(item));
62 return static_cast<const xtd::collections::generic::ienumerable<result_t>&>(result);
63}
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains as_enum struct.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains xtd::as method.
Contains std::any type and std::bad_any_cast exception.
Contains std::any type and xtd::any_object class.
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
Represent an enumerable collection.
Definition enumerable_collection.hpp:43
static const ienumerable< result_t > & cast(const ienumerable< source_t > &source) noexcept
Casts the elements of an xtd::collection::generic::ienumerable to the specified type.
Contains xtd::convert class.
Contains xtd::convert class.
Contains xtd::convert_string class.
Contains xtd::linq::enumerable_collection <type_t> class.
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:57
Contains xtd::invalid_cast_exception exception.
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
Contains xtd fundamental types.