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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:55:59+00:00 2026-06-02T10:55:59+00:00

Possible Duplicate: C++ 'mutable' keyword When have you used C++ 'mutable' keyword? I understand

  • 0

Possible Duplicate:
C++ 'mutable' keyword
When have you used C++ 'mutable' keyword?

I understand what mutable means and how it is used, What I would like to know is what is the real motivation behind its existence. I don’t think the only motivation is to bypass the immutability of this in const member functions I rather think there is something more to it.
I don’t think it is just a means to bypass problems in poorly designed systems? or is it?

An obvious offshoot of the original question when does using mutable makes sense even in a good design?

  • 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-02T10:56:00+00:00Added an answer on June 2, 2026 at 10:56 am

    mutable is part of separating bitwise const from logical const.
    Basically, what the compiler implements is called bitwise const: it
    complains if you try to modify the bits of the actual object in a const
    function, but not otherwise. When you write a class, you want to
    implement logical const: a const function doesn’t modify the observable
    value of the object (where the author of the class defines what is
    observable value). Mostly, this is a question of not modifying things,
    even when you could (e.g. parts of the value accessed through pointers),
    but every so often, there are “bits” in the actual object (as seen by
    the compiler) which aren’t part of the observable value: cached values
    calculated lazily are the classical example, but one can imagine others:
    elements in an intrusive linked list, for example, where moving the
    element around in the list requires updating pointers to previous and
    next (but where the location of the element in the list is not part of
    the element’s observable value).

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

Sidebar

Related Questions

Possible Duplicate: C# driver development? I would like to know if I can do
Possible Duplicate: least astonishment in python: the mutable default argument I want to understand
Possible Duplicate: Find the number of columns in a table I would like to
Possible Duplicate: When do you use the “this” keyword? If I have the following
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I'm trying to create
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I was working on
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument def f(a, L=[]): L.append(a)
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument Edit: This has nothing
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: How to call a JavaScript function from PHP? I have a php

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.