Skip to content

Instantly share code, notes, and snippets.

View MartinNowak's full-sized avatar
🎯
Focusing

dawg MartinNowak

🎯
Focusing
View GitHub Profile
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;
We couldn’t find that file to show.
We couldn’t find that file to show.
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;
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#include "array.hpp"
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// This is header only, so we just need to create an empty compile unit.
import std.conv;
struct CppMangler
{
CppMangler namespace(string name)
{
return nested(name);
}
CppMangler klass(string name)
/**
*
*/
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;
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()
{
;;; 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
import std.traits;
import core.memory;
struct Ptr(T)
{
static if (is(T == class))
alias T RefT;
else
alias T* RefT;