Represents a boxed object.
Public Aliases | |
| using | value_type |
| Represents the value type. | |
| using | reference |
| Represents the reference type. | |
| using | const_reference |
| Represents the cont reference type. | |
| using | pointer |
| Represents the reference type. | |
| using | const_pointer |
| Represents the cont reference type. | |
Public Properties | |
| value_type | value |
| Gets or sets the underlying value. | |
Public Constructors | |
| box ()=default | |
| Initialize a new xtd::box object. | |
| box (const_reference value) | |
| Initialize a new xtd::box object with specified value. | |
| template<typename ... args_t> | |
| box (args_t &&...args) | |
| Initialize a new xtd::box object with specified value. | |
Public Opertors | |
| operator value_type () const noexcept | |
| Cast operator to the value type. | |
Public Methods | |
| auto | compare_to (const box &value) const noexcept -> xtd::int32 override |
| Compares the current instance with another object of the same type. | |
| auto | equals (const object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const box &value) const noexcept -> bool override |
| Indicates whether the current object is equal to another object of the same type. | |
| auto | get_hash_code () const noexcept -> xtd::usize override |
| Serves as a hash function for a particular type. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a xtd::string that represents the current object. | |
| auto | to_string (const xtd::string &format) const -> xtd::string |
| Converts the value of this instance to its equivalent string representation, using the specified format. | |
| auto | to_string (const xtd::string &format, const globalization::culture_info &culture) const -> xtd::string override |
| Converts the value of this instance to its equivalent string representation, using the specified format, and locale. | |
Public Static Methods | |
| static auto | parse (const xtd::string &value) -> value_type |
| Converts the string to its value_type equivalent. | |
| static auto | try_parse (const xtd::string &value, reference result) noexcept -> bool |
| Converts the string to its value_type equivalent. A return value indicates whether the conversion succeeded or failed. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | compare_to (const type_t &obj) const noexcept -> xtd::int32=0 |
| Compares the current instance with another object of the same type. | |
| virtual auto | equals (const type_t &) const noexcept -> bool=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
| using xtd::box< type_t >::value_type |
Represents the value type.
| using xtd::box< type_t >::reference |
Represents the reference type.
| using xtd::box< type_t >::const_reference |
Represents the cont reference type.
| using xtd::box< type_t >::pointer |
Represents the reference type.
| using xtd::box< type_t >::const_pointer |
Represents the cont reference type.
|
inline |
Initialize a new xtd::box object with specified value.
| value | Value used to initialize object. |
|
inline |
Initialize a new xtd::box object with specified value.
| ...args_t | Params used to initialize object. |
|
inlinenoexcept |
Cast operator to the value type.
|
inlinenodiscardoverridenoexcept |
Compares the current instance with another object of the same type.
| value | An object to compare with this instance. |
| Value | Condition |
|---|---|
| Less than zero | This instance is less than obj. |
| Zero | This instance is equal to obj. |
| Greater than zero | This instance is greater than obj. |
|
inlinenodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
inlinenodiscardoverridenoexcept |
Indicates whether the current object is equal to another object of the same type.
| obj | An object to compare with this object. |
|
inlinenodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
nodiscard |
Converts the value of this instance to its equivalent string representation, using the specified format.
| format | A value type format string. |
|
nodiscardoverridevirtual |
Converts the value of this instance to its equivalent string representation, using the specified format, and locale.
| format | A value type format string. |
| culture | An xtd::globalization::culture_info object that contains culture information. |
Implements xtd::iformatable.
|
inlinestaticnodiscard |
Converts the string to its value_type equivalent.
| value | A string containing a value_type to convert. |
|
inlinestaticnodiscardnoexcept |
Converts the string to its value_type equivalent. A return value indicates whether the conversion succeeded or failed.
| value | A string containing a value_type to convert. |
| result | A value_type equivalent to the native value contained in value. |
| value_type xtd::box< type_t >::value |
Gets or sets the underlying value.
| value | The value to set to the underlying value. |