22.11.2017 19:06, Markus пишет:
another indicator (as documented) that GC destructor won't work
// extern(C++) classes don't have a classinfo pointer in their vtable so
the GC can't finalize them
https://github.com/dlang/druntime/blob/3d8d4a45c01832fb657c16a656b6e1566d77fb21/src/rt/lifetime.d#L9
another indicator (as documented) that GC destructor won't work
// extern(C++) classes don't have a classinfo pointer in their
vtable so the GC can't finalize them
https://github.com/dlang/druntime/blob/3d8d4a45c01832fb657c16a656b6e1566d77fb21/src/rt/lifetime.d#L90
annoying :(
Markus
On Wednesday, 22 November 2017 at 08:43:54 UTC, drug wrote:
22.11.2017 02:12, Markus пишет:
What about dtor - you allocate class using D GC but try to
destroy it manually - namely this I guess gives you an error in
rt_finalize2 because it tries to destroy object that has been
destroyed.
hmm...
22.11.2017 02:12, Markus пишет:
snip
I could do the instancing/destruction by functions and write a custom d
class that calls these methods in this()/~this().
This is what I used to do as special members like ctor/dtor did not
supported in D before, but your example of using ctor is interesti
On Wednesday, 22 November 2017 at 08:29:26 UTC, MGW wrote:
Possibly it will be interesting
https://pp.userapi.com/c639524/v639524332/60240/uH3jnxrchik.jpg
On Tuesday, 21 November 2017 at 23:12:33 UTC, Markus wrote:
hi, im trying to interface a cpp class. I'd like to interface a
bigger library and I'm trying to figure out the minimum effort.
Possibly it will be interesting
https://www.youtube.com/watch?v=HTgJaRRfLPk
On Sunday, 2 April 2017 at 16:03:51 UTC, FreeSlave wrote:
Funny thing: If I replace interface with abstract class, it
works as it should.
Also I noticed that removing inheritance in library and in
application makes unexpected results. When I try to output field
`field` I get incorrect rando
On Sunday, 2 April 2017 at 16:03:51 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
[...]
Now I see. 'Using C++ Classes From D' crashes for me too. It
also returns the wrong value from 'field' method. Sho
On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad. I've
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad. I've tested example under caption Using C++ Classes
From D. I
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad. I've tested example under caption Using C++ Classes
From D. I
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad. I've tested example under caption Using C++ Classes From
D. I used several combinations of compilers, and no one works
On Saturday, 1 April 2017 at 07:37:25 UTC, ANtlord wrote:
Hello!
Can somebody give a relevant example shows how to use C++
classes in D? I've used the exmaple from
https://dlang.org/spec/cpp_interface.html but I get a
segmentation fault as result of D application. My application
shows "Progr
On Sunday, 30 March 2014 at 11:16:16 UTC, BeschBesch wrote:
have you looked at exported symbols in dll? it may be C++ from
what you said(lib not designed for C++?), so you can try
extern(C++) on D side instead extern(C). or add manually
#ifdef __cplusplus and extern "C" on lib side(if its not t
have you looked at exported symbols in dll? it may be C++ from
what you said(lib not designed for C++?), so you can try
extern(C++) on D side instead extern(C). or add manually #ifdef
__cplusplus and extern "C" on lib side(if its not that big of
course).
First of all: I started with a C++-dll
On Saturday, 29 March 2014 at 15:03:18 UTC, BeschBesch wrote:
I want to use a set of functions that rely on a library which
is not available for D (Harfbuzz). So I just wrote myself a set
a functions that will do anything I need (Init, Free, Fonts,
Text, etc).
The DLL is working fine and dyna
extern (C) /// needed so the compiler can link the functions
{
void Test();
}
The function of course is called "Test1" not Test.
On Friday, December 13, 2013 01:17:41 Jonathan M Davis wrote:
> or you could do something like
>
> auto cstr = str.dup.ptr;
Wait. That was stupid of me. Don't do this. It'll give you a char*, but it
won't be null-terminated. If you need char*, then use toUTFz!(char*) - though
from what Mike's s
On 12/13/2013 5:00 PM, Dfr wrote:
Hello
I trying to write simple wrapper around pcre and have problem passing
strings to it. As i understood, the best way is std.string.toStringZ.
So, my code look like:
string pattern = "";
pcre_compile2( toStringz(pattern), options, &errcode, &errmsg,
&er
On Friday, December 13, 2013 09:00:20 Dfr wrote:
> Hello
>
> I trying to write simple wrapper around pcre and have problem
> passing strings to it. As i understood, the best way is
> std.string.toStringZ.
>
> So, my code look like:
>
> string pattern = "";
> pcre_compile2( toStringz(pattern)
On Friday, 13 December 2013 at 08:00:21 UTC, Dfr wrote:
Hello
I trying to write simple wrapper around pcre and have problem
passing strings to it. As i understood, the best way is
std.string.toStringZ.
So, my code look like:
string pattern = "";
pcre_compile2( toStringz(pattern), optio
21 matches
Mail list logo