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 8897421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:20:22+00:00 2026-06-15T00:20:22+00:00

I am aware that relational operators for pointers give reliable results only in limited

  • 0

I am aware that relational operators for pointers give reliable results only in limited cases, and they are not guaranteed to generate a total order. However, standard function objects for those operators do have specializations which generate a total order.

So what’s preventing the same rule applying for built-in operators? That doesn’t seem to simplify anything, since reliable comparison is still needed (by some implementation-specific method) for those function objects to work.

Furthermore, is it possible do reliable comparison on pointers with only built-in operators? Although it looks like impossible, I would like to confirm it here.

  • 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-06-15T00:20:24+00:00Added an answer on June 15, 2026 at 12:20 am

    It’s not that they don’t generate a total order, but simply that they are not guaranteed to do so. In practice, they typically will obey a total ordering on most modern hardware. It’s just not guaranteed by the standard.

    Of course, an implementation could always force them to do so, but then it comes down to the C++ guiding principle, “you don’t pay for what you don’t use”. On some CPUs it may be more expensive to do that.

    Suppose you have a CPU with a more complex address model, like, say, a segmented address space. In that case, it is no longer quite as trivial to determine if one pointer is “greater than” another. So the C++ standard allows for both: the “usual” weak pointer comparison rules only guarantee a total ordering for certain limited cases (basically, when pointers point into the same array, which is guaranteed to be linear and sequential and can be implemented very efficiently), and wrapper functions such as std::less which on some CPUs may be more expensive, but which do guarantee a total ordering for all pointers.

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

Sidebar

Related Questions

I am aware that MD5 hashes are not advisable for security any more but
I'm aware that map is not prepared to be sorted. It's heavily optimized for
I am aware that XDebug's delta should not be considered accurate. However, when tracing
I am aware that Action Script does not provide multithreading so when writing flex
I am aware that you might be thinking " Do not store user's credentials,
I am aware that Live TV is the only gTV application that can run
I aware that this will be a less programming question, but still... How can
I am aware that I can set null like string val = null; But
I'm aware that this is possible with the os module's os.system(color) function, but this
Now I'm aware that adding listeners, then setting fields would trigger the change. So

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.