- among
- castSwitch
- clamp
- cmp
- equal
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
int foo(int a, int b) | |
{ | |
return (a % 3235272) % b; | |
} | |
int bar(int a) | |
{ | |
return foo(a, 88); | |
} |
I hereby claim:
- I am wilzbach on github.
- I am wilzbach (https://keybase.io/wilzbach) on keybase.
- I have a public key ASCb_lSaTUIpgCkSWKavzANuc6EEcWTW9FGoWkETTizbKQo
To claim this, I am signing this object:
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.range, std.traits; | |
import std.stdio; | |
private void doNotOptimizeAway(T)(auto ref T t) | |
{ | |
import core.thread : getpid; | |
import std.stdio; | |
if(getpid() == 1) { | |
writeln(*cast(char*)&t); | |
} |
title | layout | date | categories | ||
---|---|---|---|---|---|
The Expressive C++17 Coding Challenge in D |
post |
2018-02-13 08:48:57 -0800 |
|
You might have seen that I have been coding a lot in D lately and as a few weeks ago there was the Expressive C++17 Coding Challenge with its solution in C++ and Rust now being public, I thought this is an excellent opportunity to show why I like D so much.
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
alias Identity(alias A) = A; | |
template AliasSeq(TList...) | |
{ | |
alias AliasSeq = TList; | |
} | |
template staticMap(alias F, T...) | |
{ | |
static if (T.length == 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
%% Listings definition for D programming language | |
%% Author : Jesse Phillips <[email protected]> | |
\lstdefinelanguage{D}{ | |
% Keywords | |
morekeywords=[1]{ | |
abstract, alias, align, assert, auto, body, break, cast, catch, class, const, | |
continue, debug, delegate, delete, deprecated, do, else, enum, export, | |
false, final, finally, for, foreach, foreach_reverse, function, goto, if, | |
immutable, import, in, inout, interface, invariant, is, lazy, macro, mixin, |
module | bare import time |
---|---|
std.regex | 1.04s |
std.net.curl | 0.29s |
std.zip | 0.19s |
std.path | 0.15s |
std.socket | 0.15s |
std.file | 0.14s |
std.mmfile | 0.14s |
std.datetime | 0.14s |
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
DMD=bin/dmd2/linux/bin64/dmd | |
DMD_VERSION=2.074.0 | |
LDC=bin/ldc2-$(LDC_VERSION)-linux-$(PLATFORM)/bin/ldc2 | |
LDC_VERSION=1.2.0 | |
DFLAGS=-g | |
PLATFORM=x86_64 | |
################################################################################ | |
# Auto-bootstrap DMD & LDC for outdated Debian/Ubuntu | |
################################################################################ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder