Re: getOpt with shared

2018-05-12 Thread Basile B. via Digitalmars-d-learn
On Friday, 11 May 2018 at 17:25:44 UTC, Danny Arends wrote: Hey all, Is getopt not supposed to be used with shared structs ? I don't know but if you are opened to alternative i have just tested my getopt-like function at it works with shared, i don't know why... The design is different

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
!"+="(*receiver, 1) instead. using getopt with a shared object and boolean values seems completely broken: /usr/include/dmd/phobos/std/getopt.d(895,34): Error: operation not allowed on bool *receiver += 1 /usr/include/dmd/phobos/std/getopt.d(751,46): Error: template instance `std.getopt.ha

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
ns are not allowed for shared variables. Use > > core.atomic.atomicOp!"+="(*receiver, 1) instead. > > > > using getopt with a shared object and boolean values seems completely > > broken: > > > > /usr/include/dmd/phobos/std/getopt.d(895,34): Error: operatio

Re: getOpt with shared

2018-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
numerical values: /usr/include/dmd/phobos/std/getopt.d(895,36): Deprecation: read-modify-write operations are not allowed for shared variables. Use core.atomic.atomicOp!"+="(*receiver, 1) instead. using getopt with a shared object and boolean values seems completely broken: /usr/i

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

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

Re: getOpt with shared

2018-05-11 Thread Jonathan M Davis via Digitalmars-d-learn
The problem is that I get deprecation warnings when trying to set > numerical values: > > /usr/include/dmd/phobos/std/getopt.d(895,36): Deprecation: > read-modify-write operations are not allowed for shared > variables. Use core.atomic.atomicOp!"+="(*receiver, 1) instead. >

Re: getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
when trying to set numerical values: /usr/include/dmd/phobos/std/getopt.d(895,36): Deprecation: read-modify-write operations are not allowed for shared variables. Use core.atomic.atomicOp!"+="(*receiver, 1) instead. using getopt with a shared object and boolean values seems complet

getOpt with shared

2018-05-11 Thread Danny Arends via Digitalmars-d-learn
/phobos/std/getopt.d(895,36): Deprecation: read-modify-write operations are not allowed for shared variables. Use core.atomic.atomicOp!"+="(*receiver, 1) instead. using getopt with a shared object and boolean values seems completely broken: /usr/include/dmd/phobos/std/getopt.d(895,