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
)
inline
static
noexcept
Determines whether the specified object instances are the same instance.
Parameters
object_a
The first object to compare.
object_b
The 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
;
console::write_line
(
object::reference_equals
(*
o
, *
p
));
p
=
q
;
console::write_line
(
object::reference_equals
(*
p
, *
q
));
console::write_line
(
object::reference_equals
(*
o
, *
p
));
delete
q
;
}
// This code produces the following output :
//
// true
// true
// false
xtd::console::write_line
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
xtd::object::reference_equals
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
xtd::object::object
object()=default
Create a new instance of the ultimate base class object.
xtd::null
std::nullptr_t null
Represents a null pointer value.
xtd::console_key::q
@ q
The Q key.
xtd::console_key::p
@ p
The P key.
xtd::console_key::o
@ o
The O key.
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
xtd_about_box.h:10
xtd
object
Generated on Sat Sep 14 2024 21:25:18 for xtd by
Gammasoft
. All rights reserved.