5#if !defined(__XTD_CORE_INTERNAL__)
6#error "Do not include this file: Internal use only"
13template<
class new_type,
class current_type,
class bool_t>
16template<
class new_type,
class current_type>
17struct __as_enum__<new_type, current_type, std::true_type> {
18 [[nodiscard]]
auto convert(
const current_type& value) ->
const new_type& {
19 __result__ =
static_cast<new_type
>(value);
22 [[nodiscard]]
auto convert(current_type& value) -> new_type& {
23 __result__ =
static_cast<new_type
>(value);
26 thread_local inline static new_type __result__ {};
29template<
class new_type,
class current_type>
30struct __as_enum__<new_type, current_type, std::false_type> {
31 [[nodiscard]]
auto convert(
const current_type& value) ->
const new_type& {
34 [[nodiscard]]
auto convert(current_type& value) -> new_type& {
Contains xtd::convert class.
static const new_type & to_ref(const current_type &value)
Casts a type into another type.
Definition convert_pointer.hpp:162