This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module eponymous; | |
template inputChain(R1, R2) | |
if(isInputRange!R1 && isInputRange!R2 && | |
is(ElementType!R1 == ElementType!R2)) | |
{ | |
auto inputChain(R1 r1, R2 r2) | |
{ | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ex1_a; | |
void foo() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LocalRef(T) | |
{ | |
private T* _ref; | |
this(ref T t) { _ref = &t; } | |
ref T get() pure { return *_ref; } | |
} | |
void main() | |
{ | |
int x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct S | |
{ | |
var x : Int // uses hidden storage | |
var xTimes10 : Int { | |
get { | |
return x * 10 | |
} | |
set { | |
x = newValue / 10 | |
} |
NewerOlder