xtd 0.2.0
Loading...
Searching...
No Matches
boxing.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "box.hpp"
6#include "byte_object.hpp"
7#include "char_object.hpp"
8#include "char16_object.hpp"
9#include "char32_object.hpp"
10#include "char8_object.hpp"
11#include "decimal_object.hpp"
12#include "double_object.hpp"
13#include "int16_object.hpp"
14#include "int32_object.hpp"
15#include "int64_object.hpp"
16#include "intptr_object.hpp"
17#include "ptrdiff_object.hpp"
18#include "sbyte_object.hpp"
19#include "single_object.hpp"
20#include "size_object.hpp"
21#include "slong_object.hpp"
22#include "uint16_object.hpp"
23#include "uint32_object.hpp"
24#include "uint64_object.hpp"
25#include "uintptr_object.hpp"
26#include "ulong_object.hpp"
27#include "wchar_object.hpp"
28#define __XTD_CORE_INTERNAL__
30#undef __XTD_CORE_INTERNAL__
31
33namespace xtd {
48 template<typename type_t>
49 inline auto boxing(const type_t& value) noexcept {return typename __box_enum_or_object__<type_t, typename std::is_enum<type_t>::type>::type(value);}
64 template<typename type_t, typename ...args_t>
65 inline box<type_t> boxing(args_t&& ...args) noexcept {return box<type_t>(args...);}
66
68 inline const object& boxing(const object& value) noexcept {return value;}
69 inline string boxing(const char* value) noexcept {return string(value);}
70#if defined(__xtd__cpp_lib_char8_t)
71 inline string boxing(const char8* value) noexcept {return string(value);}
72#endif
73 inline string boxing(const char16* value) noexcept {return string(value);}
74 inline string boxing(const char32* value) noexcept {return string(value);}
75 inline string boxing(const wchar* value) noexcept {return string(value);}
76 inline char_object boxing(const char& value) noexcept {return char_object(value);}
77#if defined(__xtd__cpp_lib_char8_t)
78 inline char8_object boxing(const char8& value) noexcept {return char8_object(value);}
79#endif
80 inline char16_object boxing(const char16& value) noexcept {return char16_object(value);}
81 inline char32_object boxing(const char32& value) noexcept {return char32_object(value);}
82 inline wchar_object boxing(const wchar& value) noexcept {return wchar_object(value);}
83 inline char_object boxing(char& value) noexcept {return char_object(value);}
84#if defined(__xtd__cpp_lib_char8_t)
85 inline char8_object boxing(char8& value) noexcept {return char8_object(value);}
86#endif
87 inline char16_object boxing(char16& value) noexcept {return char16_object(value);}
88 inline char32_object boxing(char32& value) noexcept {return char32_object(value);}
89 inline wchar_object boxing(wchar& value) noexcept {return wchar_object(value);}
90 inline byte_object boxing(const xtd::byte& value) noexcept {return byte_object(value);}
91 inline int16_object boxing(const int16& value) noexcept {return int16_object(value);}
92 inline int32_object boxing(const int32& value) noexcept {return int32_object(value);}
93 inline int64_object boxing(const int64& value) noexcept {return int64_object(value);}
94 inline slong_object boxing(const slong& value) noexcept {return slong_object(value);}
95 inline sbyte_object boxing(const sbyte& value) noexcept {return sbyte_object(value);}
96 inline uint16_object boxing(const uint16& value) noexcept {return uint16_object(value);}
97 inline uint32_object boxing(const uint32& value) noexcept {return uint32_object(value);}
98 inline uint64_object boxing(const uint64& value) noexcept {return uint64_object(value);}
99 inline ulong_object boxing(const xtd::ulong& value) noexcept {return ulong_object(value);}
100 inline byte_object boxing(xtd::byte& value) noexcept {return byte_object(value);}
101 inline int16_object boxing(int16& value) noexcept {return int16_object(value);}
102 inline int32_object boxing(int32& value) noexcept {return int32_object(value);}
103 inline int64_object boxing(int64& value) noexcept {return int64_object(value);}
104 inline slong_object boxing(slong& value) noexcept {return slong_object(value);}
105 inline sbyte_object boxing(sbyte& value) noexcept {return sbyte_object(value);}
106 inline uint16_object boxing(uint16& value) noexcept {return uint16_object(value);}
107 inline uint32_object boxing(uint32& value) noexcept {return uint32_object(value);}
108 inline uint64_object boxing(uint64& value) noexcept {return uint64_object(value);}
109 inline ulong_object boxing(xtd::ulong& value) noexcept {return ulong_object(value);}
110 inline single_object boxing(const float& value) noexcept {return single_object(value);}
111 inline double_object boxing(const double& value) noexcept {return double_object(value);}
112 inline decimal_object boxing(const decimal& value) noexcept {return decimal_object(value);}
113 inline single_object boxing(float& value) noexcept {return single_object(value);}
114 inline double_object boxing(double& value) noexcept {return double_object(value);}
115 inline decimal_object boxing(decimal& value) noexcept {return decimal_object(value);}
117}
Contains box_enum_or_object struct.
Contains xtd::box class.
Contains xtd::byte_object alias.
Contains xtd::char16_object alias.
Contains xtd::char32_object alias.
Contains xtd::char8_object alias.
Contains xtd::char_object alias.
Represents a boxed object.
Definition box.hpp:53
Contains xtd::decimal_object alias.
Contains xtd::double_object alias.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
auto boxing(const type_t &value) noexcept
Allows to box an object.
Definition boxing.hpp:49
int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:27
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
box_floating_point< decimal > decimal_object
Represent a boxed decimal.
Definition decimal_object.hpp:33
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.hpp:27
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
box_char< char32 > char32_object
Represent a boxed char32.
Definition char32_object.hpp:33
box_char< char16 > char16_object
Represent a boxed char16.
Definition char16_object.hpp:33
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
box_integer< slong > slong_object
Represent a boxed int16.
Definition slong_object.hpp:29
box_integer< int16 > int16_object
Represent a boxed int16.
Definition int16_object.hpp:29
box_integer< int32 > int32_object
Represent a boxed int32.
Definition int32_object.hpp:29
box_integer< uint16 > uint16_object
Represent a boxed uint16.
Definition uint16_object.hpp:29
box_char< char8 > char8_object
Represent a boxed char8.
Definition char8_object.hpp:34
box_floating_point< float > single_object
Represent a boxed single.
Definition single_object.hpp:29
box_integer< sbyte > sbyte_object
Represent a boxed sbyte.
Definition sbyte_object.hpp:29
box_integer< xtd::byte > byte_object
Represent a boxed byte.
Definition byte_object.hpp:33
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
box_floating_point< double > double_object
Represent a boxed double.
Definition double_object.hpp:33
box_char< char > char_object
Represent a boxed char.
Definition char_object.hpp:33
box_char< wchar > wchar_object
Represent a boxed wchar.
Definition wchar_object.hpp:33
box_integer< uint64 > uint64_object
Represent a boxed uint64.
Definition uint64_object.hpp:29
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
box_integer< int64 > int64_object
Represent a boxed int64.
Definition int64_object.hpp:29
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
box_integer< uint32 > uint32_object
Represent a boxed uint32.
Definition uint32_object.hpp:29
box_integer< ulong > ulong_object
Represent a boxed ulong.
Definition ulong_object.hpp:29
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.hpp:27
std::type_info type
Stores information about a type.
Definition type.hpp:23
Contains xtd::int16_object alias.
Contains xtd::int32_object alias.
Contains xtd::int64_object alias.
Contains xtd::intptr_object alias.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::intptr_object alias.
Contains xtd::sbyte_object alias.
Contains xtd::single_object alias.
Contains xtd::size_object alias.
Contains xtd::slong_object alias.
Contains xtd::uint16_object alias.
Contains xtd::uint32_object alias.
Contains xtd::uint64_object alias.
Contains xtd::uintptr_object alias.
Contains xtd::ulong_object alias.
Contains xtd::wchar_object alias.