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

  • Home
  • SEARCH
  • 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 89319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:41:53+00:00 2026-05-10T22:41:53+00:00

I this post , I’ve seen this: class MonitorObjectString: public MonitorObject { // some

  • 0

I this post, I’ve seen this:

class MonitorObjectString: public MonitorObject {     // some other declarations     friend inline bool operator==(/*const*/ MonitorObjectString& lhs,                                   /*const*/ MonitorObjectString& rhs)     { return lhs.fVal==rhs.fVal; } } 

Before we can continue, THIS IS VERY IMPORTANT:

  • I am not questioning anyone’s ability to code.
  • I am just wondering why someone would need non-const references in a comparison.
  • The poster of that question did not write that code.

This was just in case. This is important too:

  • I added both /*const*/s and reformatted the code.

Now, we get back to the topic:

I can’t think of a sane use of the equality operator that lets you modify its by-ref arguments. Do you?

  • 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. 2026-05-10T22:41:53+00:00Added an answer on May 10, 2026 at 10:41 pm

    Perhaps the classes use a form of lazy initialization. When the data is accessed, proper initialization must occur, and the data must be fetched. This may change class members.

    However, lazy initialization can be formed so that modification to the class isn’t necessary. This can be accomplished by using the Pimpl idiom (by a pointer to a private class) or by using the mutable keyword (not recommended!).

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer If a commercial option works for you, check out InnoDB… May 11, 2026 at 11:27 am
  • added an answer There's a lot that I could write about this Control… May 11, 2026 at 11:27 am
  • added an answer Here is how you can manage this using just Vim… May 11, 2026 at 11:27 am

Related Questions

I this post , I've seen this: class MonitorObjectString: public MonitorObject { // some
I read this post last night, and I noticed it was from 2006. I
Well I was reading this post and then I came across a code which
I have read this post about how to test private methods. I usually do
I just read this post about why new-line warnings exist, but to be honest
I have this function from a plugin (from a previous post) // This method
Since I'm sure many people have different standard, I've made this post a community
After some stupid musings about Klingon languages, that came from this post I began
I was reading this thread/post: https://stackoverflow.com/questions/262298/windows-c-ui-technology and am also wondering about a non .NET
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.