Remus
Namespace
rswhite4 at googlemail.com
Sun Oct 28 05:45:14 PDT 2012
Version 1.1 is now available.
Alterations:
-> Package import. I see in the forum a good solution for
package imports and so I merged it with Remus.
Because of that you can write now: import package PACKAGE_NAME :
MODULE1, MODULE2, ... ;
Short example: import package std : stdio, regex, array;
-> improved not null references:
- you can declare not null references now as Return Type (wasn't
possible before)
- detect reliable if a reference is assigned or not (and if not:
throw an error)
- delete the '@' operator: you now have the 'makeRef' function.
Short example for that:
[code]
void test(Foo& fr) { }
void main() {
Foo f = new Foo();
Foo& fr = f;
test(fr);
test(makeRef(f));
test(makeRef(new Foo));
}
[/code]
As you can see: there is no need to declare a senseless reference
variable for a function which takes only a reference: you can use
makeRef. And as you can see also: makeRef works even fine with
RValues.
-> improved Elvis Operator. And new: short elvis operator.
Example:
Foo f[ = new Foo()];
// ...
f ?= new Foo(); -> this is converted to: f = (f ? f : new Foo());
More information about the Digitalmars-d-announce
mailing list