commit 6ac991b721a66cf21bc4b096f7e40b780277bfa0 parent 2c63f3e9e0c2fc640d996d1519a3f06e8da89f0f Author: Dominik Schmidt <das1993@hotmail.com> Date: Sun, 9 Aug 2015 15:57:35 +0200 Add strings()-functions to Fortunes-aggregate. Diffstat:
dfortune.d | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/dfortune.d b/dfortune.d @@ -228,6 +228,12 @@ struct Fortunes{ end+=f.length-1; } alias chooseRandom=Fortune.chooseRandom; + auto @property strings(){ + return map!(a=>a.toString())(this); + } + auto static strings(T)(T r) if(isInputRange!T && is(ElementType!T==CookieResult)){ + return map!(a=>a.toString())(r); + } void add(string f){ Fortune n=new Fortune(f); n.initialize();