Skip to content

Instantly share code, notes, and snippets.

import mine = mine;
import original = original;
import std.stdio;
import std.datetime.stopwatch;
void main() {
import core.memory;
GC.disable;
auto times = benchmark!(() {
module embedab.hash.fixednum;
/**
* Fixed sized unsigned big integer implementation.
*
* opBinary_Support_ulong:
* - <<
* - >>
* - &
* - +
module widget.attempt5.curved;
import widget.attempt5.model;
void drawCurvedBorder(DrawContext)(ref DrawContext context) {
if (!context.model.dropShadow.isNull)
dropShadow!DrawContext(context);
// four buffers that store the current locations for each horizontal side (to be built upon)
// lets setup the initial indexes into the first of buffers with respective to horizontal side
@rikkimax
rikkimax / curved.d
Created December 13, 2019 16:57
attempt4.d
module widget.attempt4.curved;
import widget.attempt4.model;
import widget.attempt4.utils : plotEllipse;
enum WithDecorations = true;
void drawCurvedBorder(DrawContext)(ref DrawContext context) {
if (!context.model.dropShadow.isNull)
dropShadow(context);
DoublyLinkedList!Something global; // error,
//DoublyLinkedList!Something contains headconst fields and is not marked as such (globals can't be anyway)
//also its null (=void wouldn't work either since then it wouldn't be tied to a stack)
void func() @system {
DoublyLinkedList!Something ll = new DoublyLinkedList!Something(); // ok in @system code but won't allow escaping because of headconst fields.
headconst DoublyLinkedList!Something ll = new DoublyLinkedList!Something(); // ok
ll.add(Something.init);
  • Augment example struct Map(@named alias Function, @named InputType, @named ElementType) with a less exagerated signature.
auto map(alias Function, InputType)(InputType input) {
	return Map!(Function, InputType)(input);
}

struct Map(alias Function, InputType,
	@named ElementType = ElementType!InputType)
///
struct LFSR113 {
///
enum bool isUniformRandom = true;
///
enum auto empty = false;
///
@property {

Named parameters

Field Value
DIP: 1020
Review Count: 1
Author: Richard Andrew Cattermole firstname@lastname.co.nz
Implementation:
Status: Post-Community 1

TODO: some form of introductory paragraph about what goes under this

Requirements

Use cases

Semantics

import wg.util.allocator;
import std.traits : isPointer, isBasicType;
struct Optional(T) if (isBasicType!T || is(T == struct) || is(T == union)) {
@disable this(this);
this(Allocator* allocator) {
this.allocator = allocator;
}