38 template<class type_t>
42 template<
class type_t>
46 template<
class type_t>
101 return value_->equals(*
other.value_);
114 void reset() noexcept {value_.reset();}
128 value_ = std::move(
other.value_);
134 template<
class type_t>
136 template<
class type_t,
class ...args_t>
137 inline ptr<object> boxing_ptr(args_t&& ...args)
noexcept {
return new box<type_t>(args...);}
186 template<
class type_t,
class bool_t>
187 struct __is_enum_any_object__ {};
189 template<
class type_t>
190 struct __is_enum_any_object__<type_t, std::true_type> {
191 bool operator()(
const any_object& o)
const {
return is<enum_object<type_t>>(
o.value());}
194 template<
class type_t>
195 struct __is_enum_any_object__<type_t, std::false_type> {
196 bool operator()(
const any_object& o)
const {
return false;}
199 template<
class type_t,
class bool_t>
200 struct __is_polymorphic_any_object__ {};
202 template<
class type_t>
203 struct __is_polymorphic_any_object__<type_t, std::true_type> {
204 bool operator()(
const any_object& o)
const {
return is<type_t>(
o.value());}
207 template<
class type_t>
208 struct __is_polymorphic_any_object__<type_t, std::false_type> {
209 bool operator()(
const any_object& o)
const {
return __is_enum_any_object__<type_t, typename std::is_enum<type_t>::type> {}(
o);}
212 template<
class type_t>
215 return __is_polymorphic_any_object__<type_t, typename std::is_polymorphic<type_t>::type> {}(
o);
218 template<
class type_t>
221 return __is_polymorphic_any_object__<type_t, typename std::is_polymorphic<type_t>::type> {}(
o);
224 template<
class type_t>
227 return __is_polymorphic_any_object__<type_t, typename std::is_polymorphic<type_t>::type> {}(*o);
230 template<
class type_t>
233 return __is_polymorphic_any_object__<type_t, typename std::is_polymorphic<type_t>::type> {}(*o);
Contains xtd::boxing methods.
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
any_object(const type_t &value) noexcept
Initializes a new instance of the xtd::any_object class with specified value.
Definition any_object.hpp:47
any_object(type_t &value) noexcept
Initializes a new instance of the xtd::any_object class with specified value.
Definition any_object.hpp:43
string to_string() const noexcept override
Returns a xtd::string that represents the current object.
Definition any_object.hpp:110
bool equals(const any_object &other) const noexcept override
Indicates whether the current object is equal to another object of the same type.
Definition any_object.hpp:98
bool equals(const object &other) const noexcept override
Determines whether the specified object is equal to the current object.
Definition any_object.hpp:94
void reset() noexcept
Reset the current object. Set the current object to null.
Definition any_object.hpp:114
bool has_value() const noexcept
Gets a value indicating whether the current xtd::any_object object has a valid value of its underlyin...
Definition any_object.hpp:62
any_object() noexcept=default
Initializes a new instance of the xtd::any_object class.
any_object & operator=(const any_object &other)=default
Copy assignment operator. Replaces the contents with a copy of the contents of other.
int32 compare_to(const any_object &other) const noexcept override
Compares the current instance with another object of the same type.
Definition any_object.hpp:86
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
Definition any_object.hpp:106
const object & value() const
Gets the value of the current xtd::any_object object if it has been assigned a valid underlying value...
Definition any_object.hpp:67
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
object()=default
Create a new instance of the ultimate base class object.
virtual xtd::string to_string() const noexcept
Returns a xtd::string that represents the current object.
Contains xtd::enum_object struct.
Contains xtd::collections::generic::helpers::comparer struct.
@ invalid_operation
The operation is not valid.
Definition exception_case.hpp:63
std::type_info type
Stores information about a type.
Definition type.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.hpp:27
null_ptr null
Represents a null pointer value.
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.hpp:27
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
bool is(xtd::any value)
Checks if the result of an expression is compatible with a given type.
Definition is.hpp:485
@ other
The operating system is other.
Definition platform_id.hpp:58
@ o
The O key.
Definition console_key.hpp:116
Contains xtd::icomparable interface.
Contains xtd::iequatable interface.
Contains xtd::invalid_operation_exception exception.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Represents a boxed object.
Definition box.hpp:57
Implements a function object for compare data.
Definition comparer.hpp:31