@cmuratori @fahickman @neilogd @gunvulture ... or because it was crucial that it _not_ be modified. So I don't know if I can remove it.
-
-
Replying to @cmuratori
@cmuratori I'm not following who "you" and "I" are in this scenario, or why you'd want to remove it once it's there.1 reply 0 retweets 0 likes -
Replying to @fahickman
@fahickman If someone else makes a function and labels a parameter const, and I come along later and find I need to make a change...1 reply 0 retweets 0 likes -
Replying to @cmuratori
@cmuratori@fahickman ... the question is, can I remove the const to make that change, or not?2 replies 0 retweets 1 like -
Replying to @cmuratori
@cmuratori@fahickman And not just in the sense of 'is it already const in caller'. In the sense 'does the caller rely on it not changing'.3 replies 0 retweets 0 likes -
Replying to @nothings
@nothings@cmuratori The discipline you adopt to solve this dilemma is to only use const ref or non-const pointer args.1 reply 0 retweets 0 likes -
Replying to @fahickman
@fahickman@cmuratori Even if you have a pointer-to-a-pointer as a parameter, you turn the top level into a const ref?2 replies 0 retweets 0 likes -
Replying to @nothings
@nothings@cmuratori Every output param is non-const ptr. Every input param is value or const& (purely as an optimization of the former).1 reply 0 retweets 0 likes -
Replying to @fahickman
@nothings@cmuratori You can see it at the call site this way: an & means "will get modified".1 reply 0 retweets 0 likes -
Replying to @fahickman
@fahickman@nothings Not sure I see how that works. What if it was just passing its own output parameter through? There'll be no &.2 replies 0 retweets 0 likes
@cmuratori @fahickman @nothings Seems like that would lead to a false read where you think you know it's not an output, but it is.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.