libdparser

This commit is contained in:
Vadim Lopatin 2015-02-20 16:20:11 +03:00
parent b526afa7aa
commit 008e7e742f
2 changed files with 176 additions and 33 deletions

View file

@ -1,20 +1,29 @@
void main() {
}
// Computes average line length for standard input.
import std.stdio;
//changed
void main()
{
ulong lines = 0;
double sumLength = 0;
foreach (line; stdin.byLine())
{
++lines;
sumLength += line.length;
class foo(T) {
private:
static if (1) {
int n() {
T b;
return 25;
}
}
writeln("Average line length: ",
lines ? sumLength / lines : 0);
string n;
}
struct bar(X: foo) {
int n() { return 13; }
debug long n;
void func(T)(T param) {
T a = param;
}
}
void main(string[] args)
{
int n;
foo fooinst = new foo();
n = 19 + foo.n;
args[0] = "asd";
}