Operator Overloading Interface

Function

Reloads the status information object operator "==" and implements the logic for determining whether two status objects are equal by checking whether their error codes are equal.

Format

bool operator==(const Status& other) const;

Parameters

Parameter

Mandatory/Optional

Description

Value

other

Mandatory

A status object to be compared with the current status object

Status class, which is a status object.

Usage Example

Create a Status object and call the==operator.

1
2
3
auto status1 = Status(Error::Code::ERROR, "Engine init model failed: new modelBackend failed");
auto status2 = Status(Error::Code::ERROR, "Engine init model failed: new modelBackend failed");
bool isEqual = status1 == status2;

Return Value

  • true: equal
  • false: not equal