How about appender.put() with var args?

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 16 10:25:47 PDT 2015


On Wednesday, 15 April 2015 at 20:40:04 UTC, Márcio Martins wrote:
> I guess chain could work in some cases, and are not that bad on 
> the aesthetic side, I supposed. However having to include 
> std.range just for that, and more importantly, all parameters 
> having to be the same type, as opposed to just being 
> "appendable".
>
> Creating an array inline is also not an option as I generally 
> don't like to trade aesthetics <=> efficiency.

I think this works:

import std.range : only;
app.put(only("foo", var, "bar"));

http://dlang.org/phobos/std_range.html#.only


More information about the Digitalmars-d mailing list