Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualCornstalks

Posted 15 January 2013 - 04:07 PM

@Cornstalks: thanks for the example (why do you refer to "reference to non-const" as "non-const reference"?) - trying to understand it now.

Because that's how the rest of the world typically does it (at least in English). I guess you could technically call it a misnomer, maybe, but references themselves are always const (so it makes no sense to have a truly "non-const reference" (that is, a reference that can be changed to refer to another object; it's impossible in C++)), so when people talk about (non) const references, the (non) const always refers to the object that the reference refers to, not to the reference itself (since the reference itself is always const).


#1Cornstalks

Posted 15 January 2013 - 03:53 PM

@Cornstalks: thanks for the example (why do you refer to "reference to non-const" as "non-const reference"?) - trying to understand it now.

Because that's how the rest of the world typically does it (at least in English). I guess you could technically call it a misnomer, maybe, but references themselves are always const (so it makes no sense to have a truly "non-const reference" (that is, a reference that can be changed to refer to another object; it's impossible in C++)), so when people talk about (non) const references, the (non) const always refers to the object that the reference refers to, not to the reference itself.


PARTNERS