11#define __XTD_CORE_INTERNAL__
14#undef __XTD_CORE_INTERNAL__
16#define __XTD_CORE_INTERNAL__
38#undef __XTD_CORE_INTERNAL__
41#define __XTD_CORE_INTERNAL__
43#undef __XTD_CORE_INTERNAL__
45#define __XTD_CORE_INTERNAL__
47#undef __XTD_CORE_INTERNAL__
50#define __XTD_CORE_INTERNAL__
52#undef __XTD_CORE_INTERNAL__
55template<
typename new_type,
typename current_type>
56[[nodiscard]]
auto __convert_value__(current_type* value) -> new_type* {
60template<
typename result_t, xtd::iterable source_t>
62 auto source_holder = __xtd_enumerable_holder<xtd::raw_type<source_t>> {std::forward<xtd::raw_type<source_t>>(source)};
63 for (
const auto& item : source_holder.get())
67template<
typename type_t>
68template<
typename target_t>
74template<
typename type_t>
75template<
typename target_t>
81template<
typename type_t>
82template<
typename target_t>
83[[nodiscard]]
auto xtd::shared_ptr_object<type_t>::to_object() const -> target_t {
88template<
typename type_t>
89template<
typename target_t>
90[[nodiscard]]
auto xtd::shared_ptr_object<type_t>::to_pointer() const -> target_t* {
91 if (to_pointer() == null)
return null;
95template<
typename type_t,
typename deleter_t>
96template<
typename target_t>
97[[nodiscard]]
auto xtd::unique_ptr_object<type_t, deleter_t>::to_object() const -> target_t {
102template<
typename type_t,
typename deleter_t>
103template<
typename target_t>
104[[nodiscard]]
auto xtd::unique_ptr_object<type_t, deleter_t>::to_pointer() const -> target_t* {
105 if (to_pointer() == null)
return null;
109template<
typename source_type_t, xtd::usize source_rank,
typename source_allocator_t,
typename destination_type_t, xtd::usize destination_rank,
typename destination_allocator_t>
110inline auto xtd::array<>::copy(
const array<source_type_t, source_rank, source_allocator_t>& source_array,
xtd::usize source_index,
const array<destination_type_t, destination_rank, destination_allocator_t>& destination_array,
xtd::usize destination_index,
xtd::usize length) ->
void {
112 for (
auto r =
xtd::usize {};
r < source_array.rank(); ++
r)
118 destination_array.data_->items[destination_index + i] = as<destination_type_t>(source_array.data_->items[source_index + i]);
122 template<
typename type_t,
typename ...args_t>
123 [[nodiscard]]
inline auto as(
const std::variant<args_t...>& value) -> type_t {
125 return std::get<type_t>(value);
128 template<
typename type_t,
typename ...args_t>
129 [[nodiscard]]
inline auto as(std::variant<args_t...>& value) -> type_t {
131 return std::get<type_t>(value);
136 template<
typename type_t>
138 template<
typename type_t>
Contains xtd::any type and std::bad_any_cast exception.
Contains xtd::any_object class.
static auto copy(const array< source_type_t, source_rank, source_allocator_t > &source_array, const array< destination_type_t, destination_rank, destination_allocator_t > &destination_array) -> void
Copies a range of elements from an xtd::array starting at the first element and pastes them into anot...
Definition array_static.hpp:239
Represents an enumerable generator that supports deferred, lazy iteration over a collection of a spec...
Definition enumerable_generator.hpp:44
static auto throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current()) -> void
Throws an exption with specified exception case.
static auto cast(source_t &&source) -> xtd::collections::generic::enumerable_generator< result_t >
Casts the elements of an xtd::collections::generic::ienumerable to the specified type.
auto to_reference() const -> type &
Gets the stored reference.
Definition reference_wrapper_object.hpp:238
auto to_object() const -> type_t &
Gets the stored object.
Definition reference_wrapper_object.hpp:228
Contains xtd::convert class.
Contains xtd::convert class.
Contains xtd::convert_string class.
Contains xtd::enum_object struct.
constexpr xtd::expressions::placeholder< index > arg
The xtd::expressions::arg instance is the index argument used by expression.
Definition arg.hpp:61
@ value
Represnets the constant operator precedence (42).
Definition operator_precedence.hpp:30
@ argument
The argument is not valid.
Definition exception_case.hpp:31
@ invalid_cast
The cast is not valid.
Definition exception_case.hpp:63
@ rank
The rank is not valid.
Definition exception_case.hpp:93
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
@ null_pointer
The pointer is null.
Definition exception_case.hpp:79
null_ptr null
Represents a null pointer value.
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
auto any_cast(const xtd::any &operand) -> type_t
Performs type-safe access to the contained object.
Definition any_cast.hpp:22
auto as(any_object &o) -> type_t
Casts a type into another type.
Definition __as_any_object.hpp:60
@ r
The R key.
Definition console_key.hpp:122
@ i
The I key.
Definition console_key.hpp:104
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 abstract_object.hpp:8
constexpr auto length() const noexcept -> size_type
Returns the length of the current read_only_span.
Definition read_only_span.hpp:212
constexpr auto is_empty() const noexcept -> bool
Returns a value that indicates whether the current xtd::read_only_span <type_t> is empty.
Definition read_only_span.hpp:208
Contains xtd::reference_wrapper_object class.
Contains xtd::shared_ptr_object class.
Contains xtd fundamental types.