Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #7697

Re: mutable v's non const

From Daniel Weber <usenet@daniel-weber.eu>
Newsgroups comp.lang.c++
Subject Re: mutable v's non const
Date 2011-07-10 12:41 +0200
Organization weretis.net
Message-ID <ivbvl5$oj2$1@weretis.net> (permalink)
References <A00Sp.5482$Zm3.103@newsfe11.ams2> <ivb9mo$grv$1@dont-email.me> <lRdSp.28808$Ll1.18268@newsfe24.ams2>

Show all headers | View raw


Am 10.07.2011 10:58, schrieb Paul:
> Why would you make such a function const in the first place?
> If its not const why mark it as const?

Consider the difference between technically const and semantically const.

You might e.g. have a class (the program's configuration settings) which 
needs to synchronize parallel calls to some/all methods and therefore 
has a helper attribute which is used for the synchronization. When one 
of the synchronized method is semantically const - it doesn't change any 
of the configuration settings - but it has to change the helper attribute...

Bye,
	Daniel

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-09 18:15 +0100
  Re: mutable v's non const red floyd <no.spam.here@its.invalid> - 2011-07-09 21:26 -0700
    Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 09:58 +0100
      Re: mutable v's non const Ian Collins <ian-news@hotmail.com> - 2011-07-10 21:16 +1200
      Re: mutable v's non const Daniel Weber <usenet@daniel-weber.eu> - 2011-07-10 12:41 +0200
        Re: mutable v's non const Leigh Johnston <leigh@i42.co.uk> - 2011-07-10 14:01 +0100
          Re: mutable v's non const Miles Bader <miles@gnu.org> - 2011-07-10 23:35 +0900
          Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 16:15 +0100
        Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 16:12 +0100
          Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 16:21 +0100
            Re: mutable v's non const Werner Erasmus <werasm@gmail.com> - 2011-07-10 21:55 +0200
              Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 21:45 +0100
                Re: mutable v's non const Leigh Johnston <leigh@i42.co.uk> - 2011-07-10 22:03 +0100
                Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-10 23:37 +0100
                Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-11 17:43 +0100
                Re: mutable v's non const Leigh Johnston <leigh@i42.co.uk> - 2011-07-11 17:48 +0100
                Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-11 18:04 +0100
                Re: mutable v's non const Leigh Johnston <leigh@i42.co.uk> - 2011-07-11 18:14 +0100
                Re: mutable v's non const "Paul" <pchristor@yahoo.co.uk> - 2011-07-11 18:32 +0100
                Re: mutable v's non const Oliver Jackson <chexmofo@hotmail.com> - 2011-07-12 12:32 -0700
                Re: mutable v's non const "io_x" <a@b.c.invalid> - 2011-07-12 09:42 +0200
      Re: mutable v's non const Werner Erasmus <werasm@gmail.com> - 2011-07-10 17:17 +0200
      Re: mutable v's non const Juha Nieminen <nospam@thanks.invalid> - 2011-07-12 06:04 +0000
    Re: mutable v's non const "MikeP" <mp011011@some.org> - 2011-07-15 00:50 -0500

csiph-web