Re: pointer to object resolution

2018-05-11 Thread Alex via Digitalmars-d-learn
On Friday, 11 May 2018 at 15:24:08 UTC, Steven Schveighoffer wrote: On 5/11/18 8:53 AM, Alex wrote: This behaves differently, w.r.t. to an arbitrary method, like "operator". Why? Is there any workaround? operators don't follow pointers. Imagine if you had a struct that overloads "+" and th

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 2:49 PM, Jonathan M Davis wrote: On Friday, May 11, 2018 14:31:17 Steven Schveighoffer via Digitalmars-d- learn wrote: On 5/11/18 1:25 PM, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold se

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 14:31:17 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 5/11/18 1:25 PM, Danny Arends wrote: > > Hey all, > > > > I have been working on creating a multi-threaded application, so I have > > a shared configuration object which hold several command line parameters >

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 1:25 PM, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings when trying to set nu

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 18:01:18 Danny Arends via Digitalmars-d-learn wrote: > On Friday, 11 May 2018 at 17:49:17 UTC, Jonathan M Davis wrote: > > On Friday, May 11, 2018 17:25:44 Danny Arends via > > > > Digitalmars-d-learn wrote: > >> [...] > > > > getopt is designed to be single-threaded. The ke

Re: getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
On Friday, 11 May 2018 at 17:49:17 UTC, Jonathan M Davis wrote: On Friday, May 11, 2018 17:25:44 Danny Arends via Digitalmars-d-learn wrote: [...] getopt is designed to be single-threaded. The keyword shared is not used a single type in that module. If you want to use shared with anything in

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 17:25:44 Danny Arends via Digitalmars-d-learn wrote: > Hey all, > > I have been working on creating a multi-threaded application, so > I have a shared configuration object which hold several command > line parameters (which I fill using getopt). > > The problem is that I get

Re: getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
On Friday, 11 May 2018 at 17:25:44 UTC, Danny Arends wrote: Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings wh

getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
Hey all, I have been working on creating a multi-threaded application, so I have a shared configuration object which hold several command line parameters (which I fill using getopt). The problem is that I get deprecation warnings when trying to set numerical values: /usr/include/dmd/phobos

Re: pointer to object resolution

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/18 8:53 AM, Alex wrote: This behaves differently, w.r.t. to an arbitrary method, like "operator". Why? Is there any workaround? operators don't follow pointers. Imagine if you had a struct that overloads "+" and then you wanted to use pointer arithmetic, but instead it called ptr.o

Re: Why are deprecated aliases considered equal for resolution?

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 11, 2018 14:02:22 Nicholas Wilson via Digitalmars-d-learn wrote: > - > module a; > > struct foo {} > > deprecated alias bar = foo; > > -- > module b; > struct bar {}; > > > --- > module c; > > import a; > import b; > > void baz(bar b) {} > > Error: `a.bar` at

Why are deprecated aliases considered equal for resolution?

2018-05-11 Thread Nicholas Wilson via Digitalmars-d-learn
- module a; struct foo {} deprecated alias bar = foo; -- module b; struct bar {}; --- module c; import a; import b; void baz(bar b) {} Error: `a.bar` at source/a.d(5,1) conflicts with `b.bar` at .b.d(2,1) I would have thought the undeprecated alias would have bee

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:53:08 UTC, Basile B. wrote: On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: [...] Yeah, right guess in the title ;) you have to put the "pragma lib" again. Take the use of "pragma lib" in the binding as an information saying "you have to do this too". So

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:53:08 UTC, Basile B. wrote: On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: [...] Yeah, right guess in the title ;) you have to put the "pragma lib" again. Take the use of "pragma lib" in the binding as an information saying "you have to do this too". Ok

pointer to object resolution

2018-05-11 Thread Alex via Digitalmars-d-learn
Hi all, I'm sure, I didn't find something obvious, but: Given this: ยดยดยด void main() { auto s = S(); s.operator; assert(s.myOp(42)); assert(42 in s); auto sptr = new S(); sptr.operator; assert(sptr.myOp(42)); //assert(42 in sptr);

Re: msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread Basile B. via Digitalmars-d-learn
On Friday, 11 May 2018 at 12:35:52 UTC, TED_996 wrote: I've been trying to debug this for a long time now. I am trying to build one of the msgpack examples (examples/upacker_foreach.d) and the linking failed. I have since succeeded and I'm trying to find out if this is intended behavior or a b

msgpack link failure - non-transitive pragma(lib)?

2018-05-11 Thread TED_996 via Digitalmars-d-learn
I've been trying to debug this for a long time now. I am trying to build one of the msgpack examples (examples/upacker_foreach.d) and the linking failed. I have since succeeded and I'm trying to find out if this is intended behavior or a bug in D (not msgpack, I think). TL;DR: it seems to me

Re: Extra .tupleof field in structs with disabled postblit blocks non-GC-allocation trait

2018-05-11 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 10 May 2018 at 19:14:39 UTC, Meta wrote: So it looks like disabling a struct's postblit actually counts as having a __postblit and __xpostblit function (don't ask me why), in addition to a construction and opAssign... no idea why, and maybe this is a bug, but I bet there's a good