Hi!
I have a D template struct that reimplements a C++ class template
with identical memory layout for a set of types that matter to
me. Now, I want to use some C++ functions and classes that use
these template instances, from D. For that, I want to
purposefully alias the D and C++ types. How
On Sunday, 25 September 2022 at 23:23:51 UTC, Nicholas Wilson
wrote:
On Saturday, 24 September 2022 at 07:04:34 UTC, Gregor Mückl
wrote:
extern(C++) extern(C++, class) struct Foo(T) {
T a, b;
}
alias FooFloat = Foo!float;
extern(C++) void bar(FooFloat f);
```
This works when you mirror al
On Monday, 28 November 2022 at 02:40:28 UTC, Tejas wrote:
On Sunday, 27 November 2022 at 17:06:31 UTC, vushu wrote:
On Saturday, 16 May 2020 at 17:45:56 UTC, Konstantin wrote:
[...]
I'm actually also very curious about this issue, since I come
from c++ where this is possible, and it is a ver
On Monday, 28 November 2022 at 18:51:37 UTC, NonNull wrote:
I tested this with D threads and it works for my test program.
I might guess that this is so in general, because such a
library has to successfully work with arbitrary MS VC++ and
that "interop" is defined by MS to work.
I worked on
On Sunday, 11 December 2022 at 17:45:20 UTC, ryuukk_ wrote:
There is: https://dlang.org/phobos/std_container_dlist.html
Why is it called ``DList`` and not just ``List``, i have no clue
The D is to indicate that it is a doubly-linked list. It
maintains a forward and backward pointer chain to s
I have roughly the following code in C++ (vastly simplified from
reality):
```cpp
template
class Wrapper {
private:
T t;
bool valid;
public:
bool isValid() { return valid; }
};
template<>
class Wrapper\ {
private:
bool valid;
public:
bool isValid() { return valid; }
};
```
I can b
On Thursday, 29 February 2024 at 10:30:59 UTC, DUser wrote:
On Wednesday, 28 February 2024 at 22:48:33 UTC, Gregor Mückl
wrote:
...
But how can I bind Wrapper\ in D? Specifically, how do I
even express that template specialization in D syntax?
Did you mean any of these?
1. Parameter speciali
On Tuesday, 5 March 2024 at 00:20:36 UTC, Carl Sturtivant wrote:
On Monday, 4 March 2024 at 21:21:20 UTC, Carl Sturtivant wrote:
```
blah.obj: error LNK2019: unresolved external symbol _mul128
referenced in function MultiplyExtract128
blah.obj: error LNK2019: unresolved external symbol
__shift
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote:
Hi,
I call another process using function pipeShell and
Redirect.all.
In case the child process(also D application) throws an
exception (str to int conversion exception), the child process
shows a message box on windows.
I fo
On Wednesday, 28 August 2019 at 13:15:14 UTC, a11e99z wrote:
On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote:
Hi,
I call another process using function pipeShell and
Redirect.all.
import std;
void main()
{
auto p = pipeShell("a.exe", Redirect.all);
p.stdin.writeln("
On Thursday, 19 September 2019 at 20:47:45 UTC, Shadowblitz16
wrote:
can I do this in D and draw them to a 32bpp bitmap pixel by
pixel?
I would prefer do do this on the gpu but I don't know how.
Conceptually, applying the palette to the index buffer is easy on
the GPU. There are two ways to g
On Wednesday, 5 February 2020 at 15:54:23 UTC, Steven
Schveighoffer wrote:
I think we should be more selective about when we make parallel
threads to scan (maybe above a certain size of used memory?).
-Steve
That threshold would have to adapt to each system. How about
delaying thread startup
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
Hi
I want to start a small server, that will be accessible form
outside. Not a huge deal right?
Not quite.
My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
DMD : DMD64 D Compile
Hi!
I am trying to write a client for pretty... well... creatively
designed web API. The server gives HTTP status 500 replies if the
requests are malformed, but the actual error message is hidden in
the body of the reply (an XML document!). std.net.curl.get()
throws an exception in this case.
On Friday, 14 February 2020 at 13:23:01 UTC, Andre Pany wrote:
On Friday, 14 February 2020 at 00:24:27 UTC, Gregor Mückl wrote:
Hi!
I am trying to write a client for pretty... well... creatively
designed web API. The server gives HTTP status 500 replies if
the requests are malformed, but the
Hi!
I've just created a situation in my code that is summarized by
the following example. I don't know how to solve it with @safe
code.
A third party library provides a struct that is not copyable:
// provided by third party
struct Foo {
@disable this() @safe;
@disable this(ref retur
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer
wrote:
I want to try and learn how to write 2d games. I'd prefer to do
it with D.
I've found a ton of tutorials on learning 2d gaming with other
languages. Is there a place to look that uses D for learning?
Should I just start wit
On Wednesday, 8 April 2020 at 21:04:42 UTC, Quantium wrote:
I'm trying to do this because I have very special programm that
makes some calculations and on every calculation there is a
hash in RAM. I need to get a one of hash values from a .bin
file, and replace them. I mean hash in RAM of the p
Hi!
Consider the following code:
---
import std;
struct S {
pure this(ref return scope const S rhs) nothrow @nogc {
this.x = x;
}
int x;
}
void main()
{
S[] array = new S[10];
array.sort!("a.x < b.x", SwapStrategy.stable);
}
---
In this program, sort compiles on
On Monday, 13 April 2020 at 15:38:33 UTC, Steven Schveighoffer
wrote:
On 4/13/20 10:24 AM, Steven Schveighoffer wrote:
This is a bug in phobos.
https://issues.dlang.org/show_bug.cgi?id=20732
https://github.com/dlang/phobos/pull/7442
-Steve
Sorry for sending you down that particular rabbit
Hi!
How do I wrap an existing C++ class with a virtual destructor in
D? Take, for example, this C++ class:
class Base {
public:
virtual ~Base();
virtual void foo() = 0;
}
What does the equivalent extern(C++) declaration in D look like?
I don't care about calling the destructor. My o
Consider the following code:
```d
class Foo { }
class Bar { Foo foo = new Foo(); }
void main()
{
Bar b1 = new Bar();
Bar b2 = new Bar();
assert(b1.foo != b2.foo);
}
```
The assert fails. This is completely surprising to me. Is this
actually expected?
On Wednesday, 9 June 2021 at 18:04:54 UTC, evilrat wrote:
On Wednesday, 9 June 2021 at 17:56:24 UTC, Gregor Mückl wrote:
Consider the following code:
```d
class Foo { }
class Bar { Foo foo = new Foo(); }
void main()
{
Bar b1 = new Bar();
Bar b2 = new Bar();
assert(b1
23 matches
Mail list logo