std.data.json formal review

Suliman via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 1 08:04:51 PDT 2015


On Saturday, 1 August 2015 at 14:52:55 UTC, Sönke Ludwig wrote:
> Am 01.08.2015 um 16:15 schrieb Suliman:
>> Look like it's Variant type. So I tried to use method get! do 
>> extract
>> value from it
>> writeln(get!(response["code"]));
>>
>> But I get error: Error: variable response cannot be read at 
>> compile time
>
> The correct syntax is: response["code"].get!int

connectInfo.statusCode = response["code"].get!int;

std.variant.VariantException at std\variant.d(1445): Variant: 
attempting to use incompatible types 
stdx.data.json.value.JSONValue and int




More information about the Digitalmars-d mailing list