Re: inout and templates don't mix...

2016-03-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/23/16 6:25 PM, Ali Çehreli wrote: On 03/23/2016 02:31 PM, cy wrote: > struct Someop(Type) { >Type thing; >void foo() { > thing.bar(); >} > } > > struct Foo { >void bar() { > import std.stdio: writeln; > writeln("bar"); >} > } > > struct Bar

Re: inout and templates don't mix...

2016-03-23 Thread Ali Çehreli via Digitalmars-d-learn
On 03/23/2016 02:31 PM, cy wrote: > struct Someop(Type) { >Type thing; >void foo() { > thing.bar(); >} > } > > struct Foo { >void bar() { > import std.stdio: writeln; > writeln("bar"); >} > } > > struct Bar { >void thingy(inout(Foo) foo) inout { > auto

inout and templates don't mix...

2016-03-23 Thread cy via Digitalmars-d-learn
halp There's a module that tries to define complex operations on both const and non-const structs, since it's the same operation for both. So every function that invokes those operations is copy-pasted twice, just with "const" added. Switching to inout to eliminate that huge amount of code