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
import std.stdio; | |
void main() | |
{ | |
writeln("Hello D2222"); | |
} |
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
import std.stdio; | |
void main() | |
{ | |
writeln("Hello D2222"); | |
} |
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
import std.stdio; | |
void main() | |
{ | |
writeln("Hello D2222"); | |
} |
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 Test(T...) | |
{ | |
T field; | |
this (T t) { field = t; } | |
bool opEquals(R...)(const auto ref R rhs) inout | |
{ | |
static foreach (i, _; T) | |
if (field[i] != rhs[i]) |
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
void main() | |
{ | |
import std.experimental.allocator; | |
import std.experimental.allocator.mallocator: Mallocator; | |
import std.experimental.allocator.gc_allocator : GCAllocator; | |
auto newAlloc = sharedAllocatorObject(Mallocator.instance); | |
processAllocator() = newAlloc; | |
assert(processAllocator is newAlloc); | |
processAllocator = sharedAllocatorObject(GCAllocator.instance); | |
} |
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
void main() | |
{ | |
import std.stdio: write, writeln, writef, writefln; | |
int i; | |
enum Foo { E } | |
Foo f; | |
i = f; // OK | |
f = i; // error | |
f = cast(Foo)i; // OK |
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
import std.stdio; | |
mixin template Enforcement(T) { | |
private bool _ensured; | |
private Throwable _throwable; | |
~this() { | |
if (this.hasThrowable) { | |
throw _throwable; | |
} |
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
import std.concurrency : receiveOnly, send, | |
spawn, Tid, thisTid; | |
import core.atomic : atomicOp, atomicLoad; | |
import core.sync.mutex; | |
shared Mutex mtx; | |
/* | |
Queue that can be used safely among |
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
import std.concurrency : receiveOnly, send, | |
spawn, Tid, thisTid; | |
import core.atomic : atomicOp, atomicLoad; | |
import core.sync.mutex; | |
shared Mutex mtx; | |
/* | |
Queue that can be used safely among |
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
import std.concurrency : receiveOnly, send, | |
spawn, Tid, thisTid; | |
import core.atomic : atomicOp, atomicLoad; | |
import core.sync.mutex; | |
shared Mutex mtx; | |
/* | |
Queue that can be used safely among |