This file contains hidden or 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
| struct S | |
| { | |
| var x : Int // uses hidden storage | |
| var xTimes10 : Int { | |
| get { | |
| return x * 10 | |
| } | |
| set { | |
| x = newValue / 10 | |
| } |
This file contains hidden or 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
| struct LocalRef(T) | |
| { | |
| private T* _ref; | |
| this(ref T t) { _ref = &t; } | |
| ref T get() pure { return *_ref; } | |
| } | |
| void main() | |
| { | |
| int x; |
This file contains hidden or 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
| module ex1_a; | |
| void foo() {} |
This file contains hidden or 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
| module eponymous; | |
| template inputChain(R1, R2) | |
| if(isInputRange!R1 && isInputRange!R2 && | |
| is(ElementType!R1 == ElementType!R2)) | |
| { | |
| auto inputChain(R1 r1, R2 r2) | |
| { | |
| ... | |
| } |
This file contains hidden or 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
| <html> | |
| <body> | |
| before | |
| <table> | |
| <tr> | |
| <td>table</td><td>data</td> | |
| </tr> | |
| </table> | |
| after | |
| </body> |
This file contains hidden or 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.algorithm; | |
| import std.range; | |
| import std.string; | |
| import std.array; | |
| import std.conv; | |
| // |level|common|rare|epic|bux|xp|xptonextlevel| | |
| enum xpData = | |
| `|1|1|1|1|5|4|8| | |
| |2|2|1|1|6|5|10| |
This file contains hidden or 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.algorithm; | |
| void main(string[] args) | |
| { | |
| import std.stdio; | |
| // args[0] is the program name, args[1] through args[n] are the input strings. | |
| // first validate the input | |
| auto input = args[1 .. $]; | |
| foreach(i; 1 .. input.length) | |
| { |
This file contains hidden or 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; | |
| import vibe.d; | |
| import graphql.parser; | |
| import graphql.builder; | |
| import graphql.lexer; | |
| import graphql.ast; | |
| import graphql.helper; | |
| import graphql.schema; | |
| import graphql.traits; |
This file contains hidden or 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; | |
| struct StackFrame(T) | |
| { | |
| StackFrame* prev; | |
| T range; | |
| } | |
| struct StackRange(T, alias recurse) if (isInputRange!(typeof(recurse(T.init)))) | |
| { |
This file contains hidden or 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
| template NewFilter(alias pred, T...) | |
| { | |
| import std.meta : AliasSeq; | |
| static if(T.length == 1) | |
| { | |
| static if(pred!T) | |
| alias NewFilter = AliasSeq!(T); | |
| else | |
| alias NewFilter = AliasSeq!(); | |
| } |
OlderNewer