xtd 0.2.0
__as_pointer.hpp
Go to the documentation of this file.
1
3#pragma once
4
6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
8#endif
10
12namespace xtd {
29 template<class new_type_t, class 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);
33 }
34
51 template<class new_type_t, class 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);
55 }
56
72 template<class new_type_t, class current_type_t>
73 const new_type_t* as(const current_type_t* value) {
75 }
76
92 template<class new_type_t, class current_type_t>
93 new_type_t* as(current_type_t* value) {
95 }
96
113 template<class new_type_t, class current_type_t>
117
133 template<class new_type_t, class current_type_t>
137
154 template<class new_type_t, class current_type_t>
158
174 template<class new_type_t, class current_type_t>
178
195 template<class new_type_t, class current_type_t>
199}
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
static const new_type_t * to_ptr(const current_type_t *value)
Casts a type into another type.
Definition convert_pointer.hpp:46
static xtd::sptr< new_type_t > to_shared_ptr(const xtd::sptr< current_type_t > &value)
Casts a type into another type.
Definition convert_pointer.hpp:253
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
static xtd::uptr< new_type_t > to_unique_ptr(xtd::uptr< current_type_t > &value)
Casts a type into another type.
Definition convert_pointer.hpp:369
@ e
The E key.
Definition console_key.hpp:96
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8