Re: Practical difference between a struct with const members and with mutable members?

2016-04-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 09, 2016 16:07:36 pineapple via Digitalmars-d-learn wrote: > I'm mainly coming from languages that haven't got structs, let > alone the kind of differentiation D offers between > mutable/immutable/const/etc variables, so I'm still trying to > work out just when to use each -

Re: Practical difference between a struct with const members and with mutable members?

2016-04-09 Thread ag0aep6g via Digitalmars-d-learn
On 09.04.2016 18:07, pineapple wrote: What's different between these two examples, practically speaking? When would you use one over the other? struct thing1{ const int x, y; } struct thing2{ int x, y; } In this case, const is practically the same as immutable. But immutable is

Practical difference between a struct with const members and with mutable members?

2016-04-09 Thread pineapple via Digitalmars-d-learn
I'm mainly coming from languages that haven't got structs, let alone the kind of differentiation D offers between mutable/immutable/const/etc variables, so I'm still trying to work out just when to use each - What's different between these two examples, practically speaking? When would you use