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.ascii, std.algorithm, std.conv, std.range, std.stdio, std.string; | |
ulong fromHexDigit(dchar c) { | |
if (!isHexDigit(c)) | |
throw new Exception("Illegal char in hex number: "~to!string(c)); | |
return c <= '9' ? (c & 0xF) : 9 + (c & 0xF); | |
} | |
ulong fromBinDigit(dchar c) { | |
if (c == '0') return 0; |
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.random, std.traits, std.typecons, std.typetuple; | |
struct Builder(UserGens...) | |
{ | |
Tuple!TS genTuple(TS...)() | |
{ | |
Tuple!TS tup; | |
foreach(i, T; TS) | |
tup[i] = gen!T(); | |
return tup; |
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
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
#include "array.hpp" | |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
// This is header only, so we just need to create an empty compile unit. |
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.conv; | |
struct CppMangler | |
{ | |
CppMangler namespace(string name) | |
{ | |
return nested(name); | |
} | |
CppMangler klass(string name) |
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
/** | |
* | |
*/ | |
extern (C) void rt_finalize(void* p, bool det = true) | |
{ | |
debug(PRINTF) printf("rt_finalize(p = %p)\n", p); | |
static void zeromem(void *dst, size_t size) | |
{ | |
immutable n = size / size_t.sizeof; |
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 core.atomic; | |
import core.thread; | |
// debug = VERBOSE; | |
debug = PRINTF; | |
debug (VERBOSE) debug = PRINTF; | |
debug(PRINTF) extern(C) int printf(const char*, ...); | |
@property shared(SyncClass) sync() | |
{ |
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
;;; d-mode.el --- D Programming Language mode for (X)Emacs | |
;;; Requires a cc-mode of version 5.30 or greater | |
;; Author: 2007 William Baxter | |
;; Contributors: Andrei Alexandrescu | |
;; Maintainer: William Baxter | |
;; Created: March 2007 | |
;; Version: 2.0.4 (February 2008) | |
;; Keywords: D programming language emacs cc-mode |
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.traits; | |
import core.memory; | |
struct Ptr(T) | |
{ | |
static if (is(T == class)) | |
alias T RefT; | |
else | |
alias T* RefT; |