Re: OPTLINK Error 45 Too Much DEBUG Data for Old CodeView format

2015-03-23 Thread wobbles via Digitalmars-d-learn
On Sunday, 22 March 2015 at 15:29:00 UTC, Koi wrote: thank you Etienne, after i replaced dmd's link.exe my project compiles successfully in debug-mode again. i'll add this info in my todo-after-installing-DMD.txt just in case. On Sunday, 22 March 2015 at 14:29:14 UTC, Etienne wrote: This

using vibe.d to parse json

2015-03-23 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. struct RawGoogleResults { string version_; string status; string sig; string[string][][string] table; } enum json = {version:0.6,status:ok,sig:717451517,table:{cols:[{id:date,label:Date,type:date,pattern:},{id:query0,label:euro

Re: PrimitiveRef ?

2015-03-23 Thread Andre via Digitalmars-d-learn
Thanks a lot. I read it in the D Cookbook from Adam D. Ruppe. In the chapter of memory management there is a topic, how to build reference counted objects. Here this construct is explained. Kind regards André On Monday, 23 March 2015 at 20:58:48 UTC, Namespace wrote: Something like that?

Re: using vibe.d to parse json

2015-03-23 Thread Laeeth Isharc via Digitalmars-d-learn
On Tuesday, 24 March 2015 at 04:53:39 UTC, Laeeth Isharc wrote: Hi. struct RawGoogleResults { string version_; string status; string sig; string[string][][string] table; } enum json =

Re: PrimitiveRef ?

2015-03-23 Thread Baz via Digitalmars-d-learn
On Monday, 23 March 2015 at 16:58:49 UTC, Andre wrote: Hi, (needed for specifying reference behavior in a type tuple). I need exactly that behavior. I am currently unsure whether it is possible at all to have such a construct which works at user side exactly like a boolean (booleans can be

Re: PrimitiveRef ?

2015-03-23 Thread Namespace via Digitalmars-d-learn
Something like that? struct PrimitiveRef(T) { private T* _value; @property ref inout(T) get() inout pure nothrow { assert(_value); return *_value; } alias get this; this(T val) {

Re: Template reference parameter

2015-03-23 Thread ketmar via Digitalmars-d-learn
On Mon, 23 Mar 2015 22:01:03 +, rumbu wrote: I'm trying to construct a struct template where one of the template parameters is passed by reference (as option) struct S(T, U) { void opCall(T t, U u) { } } alias X = S!(T, U); alias RX = S!(T, ref U); //not working The

Template reference parameter

2015-03-23 Thread rumbu via Digitalmars-d-learn
I'm trying to construct a struct template where one of the template parameters is passed by reference (as option) struct S(T, U) { void opCall(T t, U u) { } } alias X = S!(T, U); alias RX = S!(T, ref U); //not working The objective is to call X(t, u) or RX(t, u), but in second case I

PrimitiveRef ?

2015-03-23 Thread Andre via Digitalmars-d-learn
Hi, I read that if a structure only contains a reference, it will behave like a reference type in function calls (needed for specifying reference behavior in a type tuple). I need exactly that behavior. I am currently unsure whether it is possible at all to have such a construct which works

Re: Template reference parameter

2015-03-23 Thread rumbu via Digitalmars-d-learn
On Monday, 23 March 2015 at 22:13:37 UTC, ketmar wrote: On Mon, 23 Mar 2015 22:01:03 +, rumbu wrote: I'm trying to construct a struct template where one of the template parameters is passed by reference (as option) struct S(T, U) { void opCall(T t, U u) { } } alias X = S!(T, U);

Re: Template reference parameter

2015-03-23 Thread ketmar via Digitalmars-d-learn
On Mon, 23 Mar 2015 22:39:27 +, rumbu wrote: It's working, but I don't like the value thing, ref would be better. alas. you can write a complex mixin that will generate the appropriate templates for you, though, so you'll be able to do something like this:

Re: Template reference parameter

2015-03-23 Thread weaselcat via Digitalmars-d-learn
On Monday, 23 March 2015 at 22:39:28 UTC, rumbu wrote: I have only one template and I think it's impossible to define specializations since it's supposed that a random member of A... will be passed sometime by reference: auto ref? http://dlang.org/template.html#auto-ref-parameters

Re: Template reference parameter

2015-03-23 Thread ketmar via Digitalmars-d-learn
On Tue, 24 Mar 2015 00:54:12 +, weaselcat wrote: On Monday, 23 March 2015 at 22:39:28 UTC, rumbu wrote: I have only one template and I think it's impossible to define specializations since it's supposed that a random member of A... will be passed sometime by reference: auto ref?