A few questions
Namespace
rswhite4 at googlemail.com
Fri Jul 27 06:43:48 PDT 2012
bearophile:
Yes i know, but i see there no answers.
Simen Kjaeraas:
That's exactly what i mean. Foo? or Foo! would be converted into
NotNull!Foo.
I wrote a quick and dirty solution:
http://dpaste.dzfl.pl/400079cb
Which converts this Code:
[code]
import std.stdio;
class Foo {
public:
void echo() const {
writeln("My Name is Foo.");
}
}
void foo(Foo! f) {
f.echo();
}
void bar(Foo! f) {
f.echo();
}
void main() {
Foo f = new Foo();
Foo f2;
foo(f);
bar(f2);
foo(new Foo());
bar(null);
}
[/code]
into: http://dpaste.dzfl.pl/d9375eeb
It is not perfect, but a first step. It would be desirable if the
dmd compiler could do something on its own.
What are the chances that something like this happens?
More information about the Digitalmars-d-learn
mailing list