mutable

This is a discussion on mutable within the C++ Programming forums, part of the General Programming Boards category; Where should mutable be used? I'm not sure if using it would subvert the protection const gives....

  1. #1
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493

    mutable

    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
    Posts
    47
    >>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
    Posts
    2,572
    >> 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 :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

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, 01: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, 02:31 AM
  4. const qualifier used on a function argument
    By hzmonte in forum C Programming
    Replies: 27
    Last Post: 04-19-2006, 12:08 AM
  5. Mutable members in const member functions still const
    By ripper079 in forum C++ Programming
    Replies: 3
    Last Post: 10-23-2002, 09:56 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21