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; | |
// secret sauce: https://dlang.org/spec/class.html#alias-this | |
struct DayNum { | |
int dn; | |
alias dn this; // this line makes DayNum look like an int with dn as the value | |
} | |
DayNum next(DayNum d) { |