-
-
Save andrey-zherikov/87675a4d6f4db62368c7b4d71df474a5 to your computer and use it in GitHub Desktop.
ldc crash
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
enum Font | |
{ | |
bold , | |
underline , | |
} | |
struct TextStyle | |
{ | |
auto opBinary(string op)(ubyte other) { | |
return other ? TextStyle: this; | |
} | |
} | |
template StyleImpl(ubyte styleCode) | |
{ | |
auto StyleImpl() | |
{ | |
return TextStyle(); | |
} | |
auto StyleImpl(TextStyle otherStyle) | |
{ | |
return otherStyle ~ styleCode; | |
} | |
} | |
alias bold = StyleImpl!(Font.bold); | |
alias underline = StyleImpl!(Font.underline); | |
struct Style | |
{ | |
TextStyle programName; | |
enum Default = Style( | |
bold.underline ); | |
} | |
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
ldc2.exe package.d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment