mrdocs::dom::operator==

Compare two values for equality.

Synopsis

Declared in <mrdocs/Dom/Value.hpp>
bool
operator==(
    Value const& lhs,
    Value const& rhs) noexcept;

Description

This operator uses strict equality, meaning that the types must match exactly, and for objects and arrays the children must match exactly.

The == operator behaves differently for objects compared to primitive data types like numbers and strings. When comparing objects using ==, it checks for reference equality, not structural equality.

This means that two objects are considered equal with === only if they reference the exact same object in memory.

NOTE

In JavaScript, this is equivalent to the === operator, which does not perform type conversions.

Return Value

true if the objects are equal, false otherwise

Parameters

Name Description
lhs The left operand
rhs The right operand

Created with MrDocs