25#define __XTD_STD_INTERNAL__
27#undef __XTD_STD_INTERNAL__
44 template<
typename type_t>
48 template<
typename type_t>
51 template<
typename type_t>
54 template<
typename type_t>
57 inline const object&
unboxing(
const object& value)
noexcept {
return value;}
58 inline object&
unboxing(
object& value)
noexcept {
return value;}
60 inline const char*
unboxing(
const string& value)
noexcept {
return value.c_str();}
61 inline const char*
unboxing(
string& value)
noexcept {
return value.c_str();}
63 template<
typename char_t>
64 inline const char_t*
unboxing(
const string& value) {
throw invalid_cast_exception(
"Invalid character type");}
65 template<
typename char_t>
66 inline const char_t*
unboxing(
string& value) {
throw invalid_cast_exception(
"Invalid character type");}
69 inline const char* unboxing<char>(
const string& value) {
return value.c_str();}
71 inline const char* unboxing<char>(
string& value) {
return value.c_str();}
73#if defined(__xtd__cpp_lib_char8_t)
75 inline const char8* unboxing<char8>(
const string& value) {
76 thread_local static std::u8string result;
78 return result.c_str();
81 inline const char8* unboxing<char8>(
string& value) {
82 thread_local static std::u8string result;
84 return result.c_str();
89 inline const char16* unboxing<char16>(
const string& value) {
90 thread_local static std::u16string result;
92 return result.c_str();
95 inline const char16* unboxing<char16>(
string& value) {
96 thread_local static std::u16string result;
98 return result.c_str();
102 inline const char32* unboxing<char32>(
const string& value) {
103 thread_local static std::u32string result;
105 return result.c_str();
108 inline const char32* unboxing<char32>(
string& value) {
109 thread_local static std::u32string result;
111 return result.c_str();
115 inline const wchar* unboxing<wchar>(
const string& value) {
116 thread_local static std::wstring result;
118 return result.c_str();
121 inline const wchar* unboxing<wchar>(
string& value) {
122 thread_local static std::wstring result;
124 return result.c_str();
152 inline char unboxing(
const char& value)
noexcept {
return value;}
153#if defined(__xtd__cpp_lib_char8_t)
159 inline char unboxing(
char& value)
noexcept {
return value;}
160#if defined(__xtd__cpp_lib_char8_t)
186 inline float unboxing(
const float& value)
noexcept {
return value;}
187 inline double unboxing(
const double& value)
noexcept {
return value;}
189 inline float unboxing(
float& value)
noexcept {
return value;}
190 inline double unboxing(
double& value)
noexcept {
return value;}
Contains __xtd_std_version definitions.
Contains xtd::char16 type.
Contains xtd::char32 type.
Contains xtd::char8 type.
Contains xtd::char_ type.
Represents a boxed object.
Definition box.h:53
static std::u32string to_u32string(const std::string &str) noexcept
Converts std::string to std::u32string.
static std::u8string to_u8string(const std::string &str) noexcept
Converts std::string to std::u8string.
static std::u16string to_u16string(const std::string &str) noexcept
Converts std::string to std::u16string.
static std::wstring to_wstring(const std::string &str) noexcept
Converts std::string to std::wstring.
Provides the base class for enumerations.
Definition enum_object.h:42
Contains xtd::decimal type.
Contains xtd::doule type.
type_t unboxing(const xtd::box< type_t > &value) noexcept
Allows to unbox an object.
Definition unboxing.h:45
int16_t int16
Represents a 16-bit signed integer.
Definition int16.h:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.h:27
wchar_t wchar
Represents a wide character.
Definition wchar.h:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.h:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.h:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.h:27
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.h:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.h:26
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.h:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.h:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.h:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.h:27
Contains xtd::int16 type.
Contains xtd::int32 type.
Contains xtd::int64 type.
Contains xtd::intptr type.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::sbyte type.
Contains xtd::single type.
Contains xtd::uint16 type.
Contains xtd::uint32 type.
Contains xtd::uint64 type.
Contains xtd::uintptr type.
Contains xtd::wchar type.
Contains xtd::drawing::size class.