6#define __XTD_STD_INTERNAL__
8#undef __XTD_STD_INTERNAL__
9#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
17#if defined(__xtd__cpp_lib_format)
54 object(
const object&) =
default;
55 object& operator =(
const object&) =
default;
57 bool operator ==(
const object& obj)
const noexcept;
58 bool operator !=(
const object& obj)
const noexcept;
70 virtual bool equals(
const object& obj)
const noexcept;
99 template<class object_t>
100 xtd::
uptr<object_t> memberwise_clone()
const {
101 auto object_ptr =
dynamic_cast<const object_t*
>(
this);
103 return xtd::new_uptr<object_t>(*object_ptr);
124 template<class object_a_t, class object_b_t>
125 static
bool equals(const object_a_t& object_a, const object_b_t& object_b) noexcept {
126 static_assert(std::is_base_of<xtd::object, object_a_t>::value,
"object_a does not inherit from xtd::object");
127 static_assert(std::is_base_of<xtd::object, object_b_t>::value,
"object_b does not inherit from xtd::object");
128 return object_a == object_b;
138 template<
class object_a_t,
class object_b_t>
139 static bool reference_equals(
const object_a_t& object_a,
const object_b_t& object_b)
noexcept {
140 static_assert(std::is_base_of<xtd::object, object_a_t>::value,
"object_a does not inherit from xtd::object");
141 static_assert(std::is_base_of<xtd::object, object_b_t>::value,
"object_b does not inherit from xtd::object");
142 return &object_a == &object_b;
149std::ostream& operator <<(std::ostream& os,
const xtd::object& obj)
noexcept;
Contains string definitions.
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.
virtual xtd::size get_hash_code() const noexcept
Serves as a hash function for a particular type.
static bool reference_equals(const object_a_t &object_a, const object_b_t &object_b) noexcept
Determines whether the specified object instances are the same instance.
Definition object.hpp:139
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.
Represents type declarations: class types, interface types, array types, value types,...
Definition type_object.hpp:39
Contains core_export_ keyword.
@ invalid_cast
The cast is not valid.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
Contains xtd::iequatable interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::helpers::exception_case enum class.
Contains xtd fundamental types.