C ++ проверяет, равны ли два объекта оператору перегрузки ==, всегда false?

Я пытаюсь проверить, равны ли два объекта, перегружая оператор '==' для класса. На основании всего, что я прочитал здесь, о переполнении стека и в других местах, например, этот пост:

C ++ объектное равенство

Я бы подумал, что я делаю это правильно, но я должен что-то упустить, потому что мое сравнение всегда оказывается ложным, даже если объекты одинаковы. Вот функция, в которой они сравниваются, это первый оператор if:

///////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<PossibleChar> findVectorOfMatchingChars(PossibleChar possibleChar, std::vector<PossibleChar> vectorOfChars) {
    std::vector<PossibleChar> vectorOfMatchingChars;                // this will be the return value

    for (auto possibleMatchingChar = vectorOfChars.begin(); possibleMatchingChar != vectorOfChars.end(); possibleMatchingChar++) {
        if (*possibleMatchingChar == possibleChar) {                // !!!!!!!!!!! this does not seem to work !!!!!!!!!!!!!!
            continue;                                               // !!!!!!!!!! it never gets in here, even when I'm 100% sure the variables refer to the same object
        }

        double dblDistanceBetweenChars = distanceBetweenChars(possibleChar, *possibleMatchingChar);
        double dblAngleBetweenChars = angleBetweenChars(possibleChar, *possibleMatchingChar);
        double dblChangeInArea = abs(possibleMatchingChar->intRectArea - possibleChar.intRectArea) / possibleChar.intRectArea;
        double dblChangeInWidth = abs(possibleMatchingChar->boundingRect.width - possibleChar.boundingRect.width) / possibleChar.boundingRect.width;
        double dblChangeInHeight = abs(possibleMatchingChar->boundingRect.height - possibleChar.boundingRect.height) / possibleChar.boundingRect.height;

        if (dblDistanceBetweenChars < (possibleChar.dblDiagonalSize * MAX_DIAG_SIZE_MULTIPLE_AWAY) &&
            dblAngleBetweenChars < MAX_ANGLE_BETWEEN_CHARS &&
            dblChangeInArea < MAX_CHANGE_IN_AREA &&
            dblChangeInWidth < MAX_CHANGE_IN_WIDTH &&
            dblChangeInHeight < MAX_CHANGE_IN_HEIGHT) {
            vectorOfMatchingChars.push_back(*possibleMatchingChar);
        }
    }

    return(vectorOfMatchingChars);
}

Вот переопределение == в возможномChar.h:

///////////////////////////////////////////////////////////////////////////////////////////////
bool operator == (const PossibleChar& otherPossibleChar) const {
    if (this == &otherPossibleChar) return true;
    else return false;
}

Вот все возможныйChar.h, если кто-то задается вопросом:

// PossibleChar.h

#ifndef POSSIBLE_CHAR_H
#define POSSIBLE_CHAR_H

#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>

///////////////////////////////////////////////////////////////////////////////////////////////////
class PossibleChar {
public:
    // member variables ///////////////////////////////////////////////////////////////////////////
    std::vector<cv::Point> contour;

    cv::Rect boundingRect;

    int intCenterX;
    int intCenterY;

    double dblDiagonalSize;
    double dblAspectRatio;

    int intRectArea;

    ///////////////////////////////////////////////////////////////////////////////////////////////
    static bool sortCharsLeftToRight(const PossibleChar &pcLeft, const PossibleChar & pcRight) {
        return(pcLeft.intCenterX < pcRight.intCenterX);
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////
    bool operator == (const PossibleChar& otherPossibleChar) const {
        if (this == &otherPossibleChar) return true;
        else return false;
    }

    // function prototypes ////////////////////////////////////////////////////////////////////////
    PossibleChar(std::vector<cv::Point> _contour);


};

#endif  // POSSIBLE_CHAR_H

Есть идеи, что мне не хватает? Любая помощь будет оценена.

Ответы на вопрос(2)

Ваш ответ на вопрос