xtd 0.2.0
Loading...
Searching...
No Matches

◆ reference_equals()

template<typename object_a_t , typename object_b_t >
static bool xtd::object::reference_equals ( const object_a_t &  object_a,
const object_b_t &  object_b 
)
inlinestaticnoexcept

Determines whether the specified object instances are the same instance.

Parameters
object_aThe first object to compare.
object_bThe second object to compare.
Returns
true if object_a is the same instance as object_b or if both are null references; otherwise, false.
Examples
The following code example uses xtd::object::reference_equals to determine if two objects are the same instance.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
object* o = nullptr;
object* p = null;
object* q = new object;
p = q;
delete q;
}
// This code produces the following output :
//
// true
// true
// false
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
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.h:138
object()=default
Create a new instance of the ultimate base class object.
std::nullptr_t null
Represents a null pointer value.
@ q
The Q key.
@ p
The P key.
@ o
The O key.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10