On Tuesday, 27 March 2018 at 02:43:15 UTC, Adam D. Ruppe wrote:
On Tuesday, 27 March 2018 at 02:35:23 UTC, Norm wrote:
What's the best way to do this in D?
I'd also add `@disable this();` and then a `static O make() {
return O(theAllocator.make!int(99)); }`
than you construct it with that
On Tuesday, 27 March 2018 at 02:35:23 UTC, Norm wrote:
What's the best way to do this in D?
I'd also add `@disable this();` and then a `static O make() {
return O(theAllocator.make!int(99)); }`
than you construct it with that static make function.
Hi All,
What's the best way to do this in D?
E.g.
---
struct O
{
int* value;
@disable this(this);
/+
this()
{
this.value = theAllocator.make!int(99);
}
+/
~this()
{
theAllocator.dispose(this.value);
}
}
O obj = O(); // Ideally this would be allocated but it simply run
On Monday, March 26, 2018 23:15:42 Jonathan via Digitalmars-d-learn wrote:
> Everywhere I look the advice is to avoid atomic and just mutex
> things.
>
> Why is this `a.atomicStore(b)`(memory order is seq) less safe
> than `synchronized{a=b}`? I get that when more operations or
> shared values
On Monday, 26 March 2018 at 22:13:02 UTC, Johan Engelen wrote:
On Monday, 26 March 2018 at 22:07:49 UTC, Nordlöw wrote:
When I try build my application using LDC and -flto=thin it
fails in the final linking
You must also pass `-flto=thin` during linking (a special
plugin is needed for LTO,
Everywhere I look the advice is to avoid atomic and just mutex
things.
Why is this `a.atomicStore(b)`(memory order is seq) less safe
than `synchronized{a=b}`? I get that when more operations or
shared values are used it is appropriate to mutex the entire set
of operations but why would I
On Sunday, 25 March 2018 at 21:02:26 UTC, Ali wrote:
On Sunday, 25 March 2018 at 20:52:29 UTC, Ali wrote:
On Sunday, 25 March 2018 at 20:45:58 UTC, Ali wrote:
I now see my typo, should be retro, not range
We need better IDEs, this would have been easily highlighted by
a good ide
I pasted
On Monday, 26 March 2018 at 22:07:49 UTC, Nordlöw wrote:
When I try build my application using LDC and -flto=thin it
fails in the final linking
You must also pass `-flto=thin` during linking (a special plugin
is needed for LTO, and LDC will only pass the plugin to the
linker when `-flto=` is
When I try build my application using LDC and -flto=thin it fails
in the final linking as
ldmd2
-of.dub/build/application-release-nobounds-lto-linux.posix-x86_64-ldc_2078-9FDE475789CA2E324E9DAE6A959C2B7F/knetquery
On Monday, 26 March 2018 at 21:11:12 UTC, jmh530 wrote:
Is each optimization level `x` in `-Ox` defined in the same
way for clang and ldc? If so, where's the best documentation
for it?
https://wiki.dlang.org/Using_LDC
Thx!
On Monday, 26 March 2018 at 17:55:10 UTC, bauss wrote:
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote:
Can I send data over an std.socket on multiple threads without
manual mutexing?
If not, can I send data on a separate thread than receive?
The docs for std.socket say nothing of
On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
Hi, I have this optional type I'm working on and I've run in to
a little snag when it comes to wrapping an immutable. Basically
what I want is for an Optional!(immutable T) to still be
settable to "some" value or "no" value because the
On Monday, 26 March 2018 at 18:47:17 UTC, Nordlöw wrote:
Yes I am, thanks, via the dub spec
buildType "release-nobounds" {
dflags "-mcpu=native" "-O3"
buildOptions "releaseMode" "optimize" "noBoundsCheck"
"inline"
}
I didn't measure any significant difference between -O
On Monday, 26 March 2018 at 16:02:30 UTC, Rene Zwanenburg wrote:
On Sunday, 25 March 2018 at 22:09:43 UTC, Nordlöw wrote:
eventhough I compile with -release -inline -nobounds flags.
Just to make sure: are you passing -O as well?
Yes I am, thanks, via the dub spec
buildType
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote:
Can I send data over an std.socket on multiple threads without
manual mutexing?
If not, can I send data on a separate thread than receive?
The docs for std.socket say nothing of it (which I guess means
I should assume it is not thread
Can I send data over an std.socket on multiple threads without
manual mutexing?
If not, can I send data on a separate thread than receive?
The docs for std.socket say nothing of it (which I guess means I
should assume it is not thread safe but...).
Thanks!
On Sunday, 25 March 2018 at 22:09:43 UTC, Nordlöw wrote:
eventhough I compile with -release -inline -nobounds flags.
Just to make sure: are you passing -O as well?
On Monday, March 26, 2018 10:13:08 Simen Kjærås via Digitalmars-d-learn
wrote:
> On Monday, 26 March 2018 at 09:46:57 UTC, Nicholas Wilson wrote:
> > Have a look at Rebindable:
> > https://dlang.org/phobos/std_typecons.html#rebindable
>
> Allow me to quote from aliak's post:
> > what I'm looking
On Monday, 26 March 2018 at 10:16:55 UTC, Aedt wrote:
I'm a big fan of betterC. In C, you can initialize an array
without specifying the length like this
int ia[ ] = {0, 2, 1};
That's the equivalent of D's static arrays if a variable, and is
passed to C functions as a pointer. So important
On Monday, 26 March 2018 at 10:57:28 UTC, Seb wrote:
It doesn't add -noboundscheck by default.
Typically the Makefiles allow passing an initial DFLAG
variable, but that one doesn't seem to allow it, so I just
submitted a PR to do so
(https://github.com/dlang/dmd/pull/8089).
With this PR you
On Monday, 26 March 2018 at 10:13:08 UTC, Simen Kjærås wrote:
On Monday, 26 March 2018 at 09:46:57 UTC, Nicholas Wilson wrote:
Have a look at Rebindable:
https://dlang.org/phobos/std_typecons.html#rebindable
Allow me to quote from aliak's post:
what I'm looking for is a Rebindable
On Monday, 26 March 2018 at 10:01:38 UTC, Nordlöw wrote:
On Sunday, 25 March 2018 at 20:35:01 UTC, Seb wrote:
For building everything locally, it should be as easy as:
---
git clone https://github.com/dlang/dmd
git clone https://github.com/dlang/druntime
git clone
On 03/26/2018 12:16 PM, Aedt wrote:
I'm a big fan of betterC. In C, you can initialize an array without
specifying the length like this
int ia[ ] = {0, 2, 1};
What is the translation of this?
The language doesn't have that feature. But there's a PR to add
`staticArray` to the standard
On 26/03/2018 11:16 PM, Aedt wrote:
I'm a big fan of betterC. In C, you can initialize an array without
specifying the length like this
int ia[ ] = {0, 2, 1};
What is the translation of this? Note that int[] is a different type
than C's arrays.
I'm a big fan of betterC. In C, you can initialize an array
without specifying the length like this
int ia[ ] = {0, 2, 1};
What is the translation of this? Note that int[] is a different
type than C's arrays.
https://dlang.org/spec/interfaceToC.html#data_type_compat says
there are no
On Monday, 26 March 2018 at 09:46:57 UTC, Nicholas Wilson wrote:
Have a look at Rebindable:
https://dlang.org/phobos/std_typecons.html#rebindable
Allow me to quote from aliak's post:
what I'm looking for is a Rebindable implementation that's for
value types
As can be surmised from the
On Sunday, 25 March 2018 at 20:35:01 UTC, Seb wrote:
For building everything locally, it should be as easy as:
---
git clone https://github.com/dlang/dmd
git clone https://github.com/dlang/druntime
git clone https://github.com/dlang/phobos
cd phobos && make -f posix.mak -j10
How do I build a
On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
Hi, I have this optional type I'm working on and I've run in to
a little snag when it comes to wrapping an immutable. Basically
what I want is for an Optional!(immutable T) to still be
settable to "some" value or "no" value because the
On Monday, 26 March 2018 at 08:29:31 UTC, Brian wrote:
Rust sample code:
#[cfg(name = "users")]
PHP sample code:
/*
@Table(name = "users")
*/
Java sample code:
@Table(name = "users")
How to use dlang get key name?
If I understand your question correctly:
struct Table {
string name;
Rust sample code:
#[cfg(name = "users")]
PHP sample code:
/*
@Table(name = "users")
*/
Java sample code:
@Table(name = "users")
How to use dlang get key name?
On Monday, 26 March 2018 at 06:48:45 UTC, rumbu wrote:
isNumeric applies to a type, not to a variable => IsNumeric!X
On Monday, 26 March 2018 at 06:51:48 UTC, arturg wrote:
use the type not the variables:
isNumeric!X && isNumeric!Y
Ah, missed that. Thanks a bunch!
On Sunday, 25 March 2018 at 23:00:11 UTC, Simen Kjærås wrote:
On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
struct Optional(T) {
Unqual!T value;
opAssign(T t) {
value = cast(Unqual!T)(t);
}
}
Consider this case:
Optional!(immutable int) a = some(3);
immutable int* p =
a =
On Monday, 26 March 2018 at 06:40:34 UTC, Vladimirs Nordholm
wrote:
How would I resolve this issue?
use the type not the variables:
isNumeric!X && isNumeric!Y
On Monday, 26 March 2018 at 06:40:34 UTC, Vladimirs Nordholm
wrote:
However I do not understand how to use that with my arguments.
Eg. I would expect to do something like:
void foo(X, Y, Args...)(X x, Y y, Args args)
if(isNumeric!(x) && isNumeric!(y) && args.length >= 1)
{
On Sunday, 25 March 2018 at 21:31:16 UTC, aliak wrote:
On Sunday, 25 March 2018 at 19:06:14 UTC, Vladimirs Nordholm
wrote:
On Sunday, 25 March 2018 at 18:24:37 UTC, Vladimirs Nordholm
wrote:
The underlying problems are:
* How do I ensure the two first arguments (used as
coordinates) are types
On Sunday, 25 March 2018 at 22:30:50 UTC, kinke wrote:
void foo()
{
version(LDC) pragma(inline, true); // affects foo()
...
}
Wonderful, thanks!
36 matches
Mail list logo