6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
29 template<
typename new_type_t,
typename current_type_t>
30 const new_type_t&
as(
const current_type_t& value) {
31 thread_local static __as_enum__<new_type_t, current_type_t, typename std::is_enum<current_type_t>::type>
e;
32 return e.convert(value);
51 template<
typename new_type_t,
typename current_type_t>
52 new_type_t&
as(current_type_t& value) {
53 thread_local static __as_enum__<new_type_t, current_type_t, typename std::is_enum<current_type_t>::type>
e;
54 return e.convert(value);
72 template<
typename new_type_t,
typename current_type_t>
73 const new_type_t*
as(
const current_type_t* value) {
74 return xtd::convert_pointer::to_ptr<new_type_t>(value);
92 template<
typename new_type_t,
typename current_type_t>
93 new_type_t*
as(current_type_t* value) {
94 return xtd::convert_pointer::to_ptr<new_type_t>(value);
113 template<
typename new_type_t,
typename current_type_t>
115 return xtd::convert_pointer::to_unique_ptr<new_type_t>(value);
133 template<
typename new_type_t,
typename current_type_t>
135 return xtd::convert_pointer::to_unique_ptr<new_type_t>(value);
154 template<
typename new_type_t,
typename current_type_t>
156 return xtd::convert_pointer::to_shared_ptr<new_type_t>(value);
174 template<
typename new_type_t,
typename current_type_t>
176 return xtd::convert_pointer::to_shared_ptr<new_type_t>(value);
195 template<
typename new_type_t,
typename current_type_t>
197 return xtd::convert_pointer::to_shared_ptr<new_type_t>(value);
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:57
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10