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
!"+="(*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
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
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
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
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
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.
>
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
/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,