9#define __XTD_CORE_INTERNAL__
12#undef __XTD_CORE_INTERNAL__
14#define __XTD_CORE_INTERNAL__
35#undef __XTD_CORE_INTERNAL__
37#define __XTD_CORE_INTERNAL__
39#undef __XTD_CORE_INTERNAL__
41#define __XTD_CORE_INTERNAL__
43#undef __XTD_CORE_INTERNAL__
46#define __XTD_CORE_INTERNAL__
48#undef __XTD_CORE_INTERNAL__
50#define __XTD_CORE_INTERNAL__
52#undef __XTD_CORE_INTERNAL__
55template<
class new_type_t,
class current_type_t>
56new_type_t* __convert_value__(current_type_t* value) {
57 return xtd::as<new_type_t>(value);
60template<
class result_t,
class source_t>
62 static thread_local auto result = __opaque_xtd_linq_enumerable_collection__<result_t> {};
63 result = __opaque_xtd_linq_enumerable_collection__<result_t> {};
64 for (
const auto& item : source)
65 result.items.push_back(
xtd::
as<result_t>(item));
70template<
typename target_t>
73 return xtd::as<target_t>(to_object());
77template<
typename target_t>
79 if (to_pointer() == null)
return null;
80 return xtd::as<target_t>(to_pointer());
84 template<
class type_t>
85 type_t any_cast(
const xtd::any_object& value) {
return xtd::as<type_t>(value);}
86 template<
class type_t>
87 type_t any_cast(
xtd::any_object& value) {
return xtd::as<type_t>(value);}
Contains opaque_xtd_linq_enumerable_collection <type_t> struct.
Contains std::any type and std::bad_any_cast exception.
Contains xtd::any_object class.
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
static const ienumerable< result_t > & cast(const ienumerable< source_t > &source) noexcept
Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
type_t & to_object() const noexcept
Gets the stored object.
Definition shared_ptr_object.hpp:165
type_t * to_pointer() const noexcept
Gets the stored pointer.
Definition shared_ptr_object.hpp:175
Contains xtd::convert class.
Contains xtd::convert class.
Contains xtd::convert_string class.
Contains xtd::enum_object struct.
@ null_pointer
The pointer is null.
null_ptr null
Represents a null pointer value.
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
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::shared_ptr_object class.
Contains xtd fundamental types.