On 2009-12-16 08:54:03 -0500, "Denis Koroskin" <2kor...@gmail.com> said:
I just realized that 'inout' could have a real use even for functions
with no return value. Consider this:
void doSomething(inout(Object)[] a, inout(Object)[] b) {
a[0] = b[0]; // works only when objects in both arrays have the same
constness.
}
Doesn't work.
doSomething("hello", "world");
Well, of course it doesn't...
Here's what I meant:
void doSomething(inout(MyStruct)*[] a, inout(MyStruct)*[] b) {
a[0] = b[0]; // works only when structs in both arrays have the same
constness.
}
--
Michel Fortin
michel.for...@michelf.com
http://michelf.com/