commit cd1d2d06af665f9548dde46902b90b5b07acbed9 parent f3bc186074f8d3bc0a05756c20736a96bb7d3775 Author: Dominik Schmidt <das1993@hotmail.com> Date: Tue, 30 Jun 2015 22:24:19 +0200 Made the struct Post comparable. Now the entrys can be sorted by std.algorithm.sort(FBStream); Diffstat:
Fb2RSS.d | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/Fb2RSS.d b/Fb2RSS.d @@ -200,6 +200,20 @@ struct Post{ return uc; } + int opCmp(ref Post b) const{ + if(time<b.time){ + return -1; + } + else if(time>b.time){ + return 1; + } + else{ + return 0; + } + } + bool opEquals(ref Post b) const{ + return (opCmp(b)==0); + } } void main(string args[]){