Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4005410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:23:24+00:00 2026-05-20T08:23:24+00:00

This seems trivial yet endless searching doesn’t yield an answer. I need to compare

  • 0

This seems trivial yet endless searching doesn’t yield an answer.

I need to compare and assign.

How can I overload the COORD if I can’t add a member function or friend a function?

is it just bad style to use this windows based structure?

Also, I know I can write my own class(or just do the operation once for each member), but this problem just really has me wondering.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:23:25+00:00Added an answer on May 20, 2026 at 8:23 am

    COORD only has public members, so there’s no need for friend functions — free operators should suffice:

    bool operator <(COORD const& lhs, COORD const& rhs)
    {
        return lhs.Y < rhs.Y || lhs.Y == rhs.Y && lhs.X < rhs.X;
    }
    
    bool operator ==(COORD const& lhs, COORD const& rhs)
    {
        return lhs.X == rhs.X && lhs.Y == rhs.Y;
    }
    

    COORD has an implicit copy c’tor and operator= already, no need to define those.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems so trivial, yet I can't get it to work.. I have an
This seems like such a trivial problem, but I can't seem to pin how
This seems trivial, but I've never had to worry about it before and my
I know this seams a trivial question, but how can I disable the annoying
This seems like a simple question, but I can't find it with the Stack
Has anyone managed to extend a GridView with default sorting? This seems pretty trivial
This seems like a noob question, but the simple answer is eluding me. I
I definitely searched for this, but I can't find the answer, even though it
This seems like a trivial problem, but it has me kind of stumped. I
This seems to be a common question, but I've yet to find a very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.