emscripten
Andrej Mitrovic
andrej.mitrovich at gmail.com
Wed Dec 15 02:27:48 PST 2010
On 12/14/10, Vladimir Panteleev <vladimir at thecybershadow.net> wrote:
>
> if (resource == "/getfoo")
> {
> struct FooResult { int n; string s; }
> return toJSON(FooResult(42, "bar")); // {"n":42,"s":"bar"}
> }
Funny thing about that commented out code. I've tried returning
something like that once from a function:
return { int n = 42; string s = "bar"; }
So basically a struct that has it's members default-initialized with
some values. Unfortunately D thought I was returning a delegate
instead, so I can't use this syntax.
More information about the Digitalmars-d
mailing list