unboxed
and boxed
types listed below. The unboxed
types is same as the native type. The boxed
type is an xtd::box inherited from xtd::object.For more performance prefere used unboxed
type. Used boxed
type when necessary, e.g., to parse, polymorphism, ...
(1) Depend of OS : if build on Windows is 2 bytes, if build on Linux or many other non-Windows systems is 4 bytes.
(2) Depend of build : if build in 32 bits the size is 4 bytes, if build in 64 bits the size is 8 bytes.
(3) xtd::decimal is an extended precision floating-point type. Matches IEEE-754 binary128 format if supported, otherwise matches IEEE-754 binary64-extended format if supported, otherwise matches some non-IEEE-754 extended floating-point format as long as its precision is better than binary64 and range is at least as good as binary64, otherwise matches IEEE-754 binary64 format.
long double
in the same format as double
, i.e. binary64).(4) The std::string type is the main string datatype in standard C++ since 1998, but it was not always part of C++98.
For more information about c++ type see cppreference language type section.
For the complete list of xtd types see xtd - Referecne Guide - types section.
Limitsxtd define the minimum and maximum constant value for each types.
Of course, std::numeric_limits works for the types described above except for xtd::date_time.
BoxingFor explicit boxing a type into corresponding object class use xtd::boxing method. By default, the boxing implicit in the corresponding object is used.
bool value_unboxed = true;
xtd::boolean_object value_boxed1 = value_unboxed;
xtd::boolean_object value_boxed2 = xtd::boxing(value_unboxed);
auto ready_boxed3 = xtd::boxing(value_unboxed);
Unboxing
For explicit unboxing a object class into corresponding type use xtd::unboxing method. By default, the unboxing implicit in the corresponding type is used.
xtd::boolean_object value_boxed = true;
bool value_unboxed1 = value_boxed;
bool value_unboxed2 = xtd::unboxing(value_boxed);
auto value_unboxed3 = xtd::unboxing(value_boxed);
See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4