On Saturday, 6 January 2018 at 11:20:01 UTC, Seb wrote:
On Saturday, 6 January 2018 at 11:17:56 UTC, Seb wrote:
On Friday, 5 January 2018 at 13:02:12 UTC, qznc wrote:
I'm exploring [0] C++ interop after watching Walter's
presentation [1].
[...]
I know about this:
I'm exploring [0] C++ interop after watching Walter's
presentation [1].
I hit a block with classes as template parameters. This means
vector works, but vector does not. D seems to map
vector!Foo to vector. Likewise shared_ptr is a
problem. Any way to fix that on the D side? The ugly
On Wednesday, 12 April 2017 at 13:17:42 UTC, solidstate1991 wrote:
How can I make use of T? I've seen it being used many times for
this application.
What "T"? This letter is often used as a generic template
parameter. Are you talking about templates?
Maybe you can give some examples of the
Are there any general tips or best practices for bindings in dub
packages?
For example, I love the d2sqlite3 package. It just works out of
the box. No linker configuration or anything. However, that is
probably a testament to sqlite's lack of dependencies. That
cannot work for libraries,
On Thursday, 1 September 2016 at 10:30:12 UTC, Guillaume Piolat
wrote:
On Thursday, 1 September 2016 at 07:46:04 UTC, qznc wrote:
I find the documentation on MemoryOrder lacking about the
semantics of rel. :(
[0] https://dlang.org/library/core/atomic/memory_order.html
What helped me was
On Thursday, 1 September 2016 at 06:44:13 UTC, mogu wrote:
I found an implementation of spinlock in concurrency.d.
```
static shared struct SpinLock
{
void lock() { while (!cas(, false, true)) {
Thread.yield(); } }
void unlock() { atomicStore!(MemoryOrder.rel)(locked,
false); }
On Saturday, 2 July 2016 at 12:21:14 UTC, Lodovico Giaretta wrote:
On Saturday, 2 July 2016 at 12:10:28 UTC, qznc wrote:
Alternatively, any better idea to implement the cache? I guess
there is no off-the-shelf/dub solution.
For now, I settled for a sorted array of cache entries plus an AA
to
I want to implement some caching for HTTP GET requests. Basically
a map of URL to content. A cache needs some additional meta data
(size, age, etc).
There seem to be two basic data structures available: Associative
array (AA) or red black tree (RBT).
With AA cache eviction is inefficient.
On Sunday, 29 May 2016 at 17:42:48 UTC, Era Scarecrow wrote:
Worse I'm not sure if the code generation already does that
and possibly does a better job than what we could do by hand...
Not with dmd v2.071.0 or ldc 0.17.1.
At least not in all the variations I tried to trick them with,
like
On Sunday, 29 May 2016 at 18:15:16 UTC, qznc wrote:
On Sunday, 29 May 2016 at 17:38:17 UTC, Jonathan M Davis wrote:
And if you're not simply comparing for equality, what are you
looking to figure out? Without more information about what
you're trying to do, it's kind of hard to help you.
If
On Sunday, 29 May 2016 at 17:38:17 UTC, Jonathan M Davis wrote:
And if you're not simply comparing for equality, what are you
looking to figure out? Without more information about what
you're trying to do, it's kind of hard to help you.
If I write the comparison naively, the assembly clearly
Given two string (or char[] or ubyte[]) objects, I want to
compare them. The naive loop accesses the arrays byte-wise. How
could I turn this into a word-wise compare for better performance?
Is a cast into size_t[] ok? Some Phobos helper functions?
On Wednesday, 25 May 2016 at 09:41:10 UTC, Russel Winder wrote:
I do not really have the proper resources to host such a
repository and because of this I have not built one. I know I
should rather than just moan, but Debian is my main platform
and that is covered.
Yes, this is the core
On Tuesday, 24 May 2016 at 15:27:45 UTC, llaine wrote:
As written in the description I'm really new to D, I discovered
it a few weeks ago thanks to the D Conf in Berlin.
After playing around for couple of days with it, I wanted to
share my journey with you guys on several points.
Thanks for
On Wednesday, 2 September 2015 at 13:46:54 UTC, Namal wrote:
On Wednesday, 2 September 2015 at 13:12:39 UTC, cym13 wrote:
On Wednesday, 2 September 2015 at 13:01:31 UTC, Namal wrote:
Hello,
I want to read a file line by line and store each line in a
string. I found this example with byLine
Is it possible to profile with LDC/GDC?
At least LDC lists it as only an "idea".
http://wiki.dlang.org/LDC_project_ideas
On Thursday, 2 July 2015 at 12:10:52 UTC, Nicholas Wilson wrote:
Also is there a binding to GMP somewhere? I just hacked one
together.
I could need the bindings to fix the pidigits benchmark.
There is this 7y old code on dsource:
http://www.dsource.org/projects/bindings/browser/trunk/gmp
I stumbled upon this interesting programming challenge [0], which
imho should be possible to implement in D. Maybe someone here
wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient accessor functions.
Something like this:
enum X { A,
On Friday, 10 October 2014 at 06:27:35 UTC, yazd wrote:
On Thursday, 9 October 2014 at 21:24:55 UTC, qznc wrote:
On Thursday, 9 October 2014 at 21:14:46 UTC, qznc wrote:
How can you deep-copy a std.container.Array instance?
Ok, the deep-copy problem already got resolved on reddit: Use
dup.
On Friday, 10 October 2014 at 10:59:59 UTC, Sag Academy wrote:
On Friday, 10 October 2014 at 10:32:17 UTC, yazd wrote:
Like the following? That did not work.
Array!Foo y = Array!Foo(x[]);
How does it not work?
It compiles successfully: http://dpaste.dzfl.pl/583d20e426a0
yeah man.
You
How can you deep-copy a std.container.Array instance?
The actual array data is heap-allocated and reference-counted.
Assignment and .dup only create additional references.
Using a copy constructor yields an error:
Array!Foo x;
Array!Foo y = Array!Foo(x);
Error: template
On Thursday, 9 October 2014 at 21:14:46 UTC, qznc wrote:
How can you deep-copy a std.container.Array instance?
Ok, the deep-copy problem already got resolved on reddit: Use dup.
However, the error is still open. You cannot give an Array!X
argument to constructor/replace/insertBefore of
22 matches
Mail list logo