Not Getting Sure About "EOnlineComparisonOp"

namespace EOnlineComparisonOp
{
    enum Type
    {
        Equals,
        NotEquals,
        GreaterThan,
        GreaterThanEquals,
        LessThan,
        LessThanEquals,
        Near,
        In,
        NotIn,
    }
}

I Don’t Understand To whom shall I compare ??
Also I Searched API For this , There Are Nothing In Details.

You Said In The Video At 7:08 -

“Should It Equal To Presence , Should It Greater Than Two Players Or Less Than”

What Do You mean By That ? Can You Please Explain ??
Please?

That’s just an enum so you can tell the function how you want to compare.
Basic example

enum class Comparison
{
    Less,
    Equal,
    Greater
};

bool Compare(int A, int B, Comparison C)
{
    switch (C)
    {
    case Comparison::Less:
        return A < B;
    case Comparison::Equal:
        return A == B;
    case Comparison::Greater:
        return A > B;
    }
}
int main()
{
    bool Example = Compare(1, 2, Comparison::Less);
}

And I assume this code was written before scoped enums (enum class) existed which is why namespace Foo { enum Bar {}; } is used, it achieves almost the same thing.

Note: I have no knowledge about that section and am not the TA for this course.

1 Like

Ok Now I Understand How The Comparison Takes Place

But Can You Tell Me What The Two Things Are Comparing Here?
Like In Your Code Its A & B But Whats in The EOnlineComparisonOp ??

Based on the name FOnlineSearchSetting::Set<bool> is a set, so you’re comparing the first argument to the key and if it’s found, setting it to the second argument.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms