in vs inout

Adam D. Ruppe destructionator at gmail.com
Thu Apr 30 14:52:06 UTC 2020


On Thursday, 30 April 2020 at 14:00:40 UTC, Arredondo wrote:
> I had been using inout for some time now for "purely input 
> function parameters".

`inout` is more specifically for things you take in, look at, 
then pass back out. So it forms part of your return value.

`const` is for when you are just looking without returning any of 
it.


scope inout may be more appropriate if you are going to return it 
at all...


More information about the Digitalmars-d-learn mailing list