1 module modules.functions; 2 static import modules.templates; 3 4 5 int add1(int i, int j) { 6 return i + j + 1; 7 } 8 9 10 double add1(double d0, double d1) { 11 return d0 + d1 + 1; 12 } 13 14 15 double withDefault(double fst, double snd = 33.3) { 16 return fst + snd; 17 } 18 19 20 void storageClasses( 21 int normal, 22 return scope int* returnScope, 23 out int out_, 24 ref int ref_, 25 lazy int lazy_, 26 ) 27 { 28 29 } 30 31 32 export void exportedFunc() {} 33 34 extern(C) void externC() {} 35 36 extern(C++) void externCpp() {} 37 38 39 alias identityInt = modules.templates.identity!int; 40 41 42 shared static this() { } 43 44 static this() { } 45 46 47 unittest {} 48 49 50 auto voldermort(int i) { 51 static struct Voldermort { 52 int i; 53 } 54 55 return Voldermort(i); 56 } 57 58 59 auto voldermortArray(int i) { 60 61 static struct DasVoldermort { 62 int i; 63 } 64 65 return [DasVoldermort(i)]; 66 } 67 68 69 string concatFoo(string s0, int i, string s1) { 70 import std.conv: text; 71 return s0 ~ i.text ~ s1 ~ "foo"; 72 }