Thread: mutable

  1. #1
    Just because ygfperson's Avatar
    Join Date
    Jan 2002


    Where should mutable be used? I'm not sure if using it would subvert the protection const gives.

  2. #2
    Registered User Casey's Avatar
    Join Date
    Jun 2003
    >>Where should mutable be used?
    When the object may be const (from the client's perspective), but the internal workings require that a data member be changed.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    >> where should i use mutable.

    Inside a class on a datamember that is logically const but not physically const.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :-

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inheritance with mutable
    By major_tom3 in forum C++ Programming
    Replies: 7
    Last Post: 06-19-2009, 12:03 PM
  2. Replies: 6
    Last Post: 02-27-2009, 04:43 PM
  3. warning C4141: 'mutable' : used more than once
    By pheres in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2008, 01:31 AM
  4. const qualifier used on a function argument
    By hzmonte in forum C Programming
    Replies: 27
    Last Post: 04-18-2006, 11:08 PM
  5. Mutable members in const member functions still const
    By ripper079 in forum C++ Programming
    Replies: 3
    Last Post: 10-23-2002, 08:56 AM