Re: persistence, serialization, history (run-to-run) in small self-contained program

2016-07-13 Thread rikki cattermole via Digitalmars-d-learn
On 14/07/2016 5:18 PM, dan wrote: I'm writing a small program (compiled with gdc on xubuntu 16.04). I would like it to remember a little data (a few kilobytes maybe). It looks like d comes with standard support for both sqlite3 and json --- is there any particular reason to prefer one over the

persistence, serialization, history (run-to-run) in small self-contained program

2016-07-13 Thread dan via Digitalmars-d-learn
I'm writing a small program (compiled with gdc on xubuntu 16.04). I would like it to remember a little data (a few kilobytes maybe). It looks like d comes with standard support for both sqlite3 and json --- is there any particular reason to prefer one over the other? Or maybe something else

Re: C++ interface vs D and com

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 21:27:29 UTC, Adam Sansier wrote: Yes! your right, If you were only around to tell me that in the first place! ;) Now we know. Again, as I said before, the problem is informational. Maybe because come works 99% of the time doesn't help us in the 1% if some

Re: Some asm help for the 'thiscall' calling convention?

2016-07-13 Thread ethgeh via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 23:06:44 UTC, flamencofantasy wrote: On Wednesday, 13 July 2016 at 22:30:51 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 22:09:05 UTC, flamencofantasy wrote: On Wednesday, 13 July 2016 at 20:39:00 UTC, Adam Sansier wrote: [...] You revived this thread

Re: cant run unittests

2016-07-13 Thread ethgeh via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote: how can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...] try to put this before the main of your application: "version(unittest){}

Re: Interface final methods are erased by the overloads of a subclass

2016-07-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 14 July 2016 at 00:02:25 UTC, pineapple wrote: I was surprised when this didn't work. What's the rationale? Is there any better workaround than renaming methods? Looks like this: http://dlang.org/hijack.html Just add `alias foo = A.foo;` to B and it should work.

Interface final methods are erased by the overloads of a subclass

2016-07-13 Thread pineapple via Digitalmars-d-learn
I was surprised when this didn't work. What's the rationale? Is there any better workaround than renaming methods? interface A{ void foo(); final void foo(int x){} } class B: A{ void foo(){} } void main(){ auto b = new B(); b.foo();

Re: Some asm help for the 'thiscall' calling convention?

2016-07-13 Thread flamencofantasy via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 22:30:51 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 22:09:05 UTC, flamencofantasy wrote: On Wednesday, 13 July 2016 at 20:39:00 UTC, Adam Sansier wrote: On Sunday, 24 April 2011 at 22:09:24 UTC, Kagamin wrote: Andrej Mitrovic Wrote: But trying to use

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 21:27:16 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 21:12:29 UTC, Adam Sansier wrote: [...] Ok, I like! [...] I like too! But I'll have to assume you are right since I have no proof. [...] Well, one could do this with malloc because one

Experimenting with templates

2016-07-13 Thread Bahman Movaqar via Digitalmars-d-learn
Following up my D practices, I've created a 'groupBy' template[1] for Stockman (my practice project). I'd like to ask you more experienced folks to please take a look at it. As this is my first template, I'd like to know if I am doing anything idiomatically/logically wrong. PS: I've also

Re: Some asm help for the 'thiscall' calling convention?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 22:09:05 UTC, flamencofantasy wrote: On Wednesday, 13 July 2016 at 20:39:00 UTC, Adam Sansier wrote: On Sunday, 24 April 2011 at 22:09:24 UTC, Kagamin wrote: Andrej Mitrovic Wrote: But trying to use functions which take parameters will fail with an access

Re: Some asm help for the 'thiscall' calling convention?

2016-07-13 Thread flamencofantasy via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:39:00 UTC, Adam Sansier wrote: On Sunday, 24 April 2011 at 22:09:24 UTC, Kagamin wrote: Andrej Mitrovic Wrote: But trying to use functions which take parameters will fail with an access violation, probably because D uses stdcall for COM methods, while these

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:47:21 UTC, John wrote: On Wednesday, 13 July 2016 at 20:28:40 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 19:22:44 UTC, Kagamin wrote: On Wednesday, 13 July 2016 at 16:48:53 UTC, Adam Sansier wrote: There's a lot of misinformation on the net.

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 21:12:29 UTC, Adam Sansier wrote: The advantages over a simple malloc are: 1) You can change between GC allocation, malloc, mmap and other allocators by changing a single line, instead of changing every throw; Ok, I like! 2) you can use very fast allocators,

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:57:49 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 20:44:52 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 16:28:23 UTC, Lodovico Giaretta wrote: It's actually quite easy. Here's the code (untested):

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:44:52 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 16:28:23 UTC, Lodovico Giaretta wrote: It's actually quite easy. Here's the code (untested): import

Re: C++ interface vs D and com

2016-07-13 Thread John via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:28:40 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 19:22:44 UTC, Kagamin wrote: On Wednesday, 13 July 2016 at 16:48:53 UTC, Adam Sansier wrote: There's a lot of misinformation on the net. Nope, it's just you. COM support in D and in general works

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 16:28:23 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 16:13:21 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 11:39:11 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 00:57:38 UTC, Adam Sansier wrote: [...] You shall use a

Re: Some asm help for the 'thiscall' calling convention?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Sunday, 24 April 2011 at 22:09:24 UTC, Kagamin wrote: Andrej Mitrovic Wrote: But trying to use functions which take parameters will fail with an access violation, probably because D uses stdcall for COM methods, while these ASIO COM methods need to be called with 'thiscall' convention.

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 20:02:50 UTC, Jesse Phillips wrote: On Wednesday, 13 July 2016 at 02:41:22 UTC, Adam Sansier wrote: If you can convince me to try it out, I might... but doing com isn't my primary goal here and I seem to have finished up what I was trying to achieve(my use case is

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 19:22:44 UTC, Kagamin wrote: On Wednesday, 13 July 2016 at 16:48:53 UTC, Adam Sansier wrote: There's a lot of misinformation on the net. Nope, it's just you. COM support in D and in general works fine for everyone else. For anyone else having similar problems

Re: C++ interface vs D and com

2016-07-13 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 02:41:22 UTC, Adam Sansier wrote: If you can convince me to try it out, I might... but doing com isn't my primary goal here and I seem to have finished up what I was trying to achieve(my use case is probably relatively simple though). Last thing I want to do is

cant run unittests

2016-07-13 Thread dom via Digitalmars-d-learn
how can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. i really love D, but problems like this make me wanna switch :/ using: dub test --arch=x86 lucy ~master: building configuration

Re: how to mark an extern function @nogc?

2016-07-13 Thread Seb via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 02:20:58 UTC, anonymous wrote: On Tuesday, 12 July 2016 at 14:04:55 UTC, Seb wrote: D is entirely driven by highly motivated volunteers. (this will change soon with the new D foundation) With the fundation, volunteers wont be highly motivated anymore. Fundations

Re: Where does one post a proposal for a language change?

2016-07-13 Thread Seb via Digitalmars-d-learn
On Tuesday, 12 July 2016 at 16:47:26 UTC, Mathias Lang wrote: On Tuesday, 12 July 2016 at 16:45:18 UTC, DLearner wrote: General/Issues/or... P.R. to this repository: https://github.com/dlang/DIPs If you aren't sure about your change, a discussion at General might help to see the current

Re: C++ interface vs D and com

2016-07-13 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 16:48:53 UTC, Adam Sansier wrote: There's a lot of misinformation on the net. Nope, it's just you. COM support in D and in general works fine for everyone else.

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/13/16 8:41 AM, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 12:37:26 UTC, Miguel L wrote: I tried Appender, but for some reason garbage collector still seems to be running every few iterations. I will try to expand a little on my code because maybe there is something i am

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 08:34:55 UTC, John wrote: On Wednesday, 13 July 2016 at 07:31:57 UTC, Adam Sansier wrote: void** ptr = null; auto res = CoCreateInstance(_ID, cast(IUnknown)null, CLSCTX_INPROC_SERVER, _ID, cast(void**)); How are you casting your "ptr" variable

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 16:13:21 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 11:39:11 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 00:57:38 UTC, Adam Sansier wrote: [...] You shall use a static per-thread Region allocator[1] backed by Mallocator[2]. Then you

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Eugene Wissner via Digitalmars-d-learn
I'm writing currently a library, that is 100% @nogc but not nothrow, and I slowly begin to believe that I should publish it already, though it isn't ready yet. At least as example. std.experimental.allocator doesn't work nicely with @nogc. for example dispose calls destroy, that isn't @nogc. I

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:39:11 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 00:57:38 UTC, Adam Sansier wrote: [...] You shall use a static per-thread Region allocator[1] backed by Mallocator[2]. Then you just make[3] exceptions inside it and throw them. So you can

Re: built-in types inside of a union

2016-07-13 Thread zodd via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 14:01:25 UTC, Adam D. Ruppe wrote: Yes, your code is legal. What isn't legal is using some type that isn't there at runtime, like union A { int[] a; char[] b; } A u; u.a = [1,2]; u.b.length The compiler will let you do it, but being a union, it will

Re: built-in types inside of a union

2016-07-13 Thread Ali Çehreli via Digitalmars-d-learn
On 07/13/2016 07:01 AM, Adam D. Ruppe wrote: > On Wednesday, 13 July 2016 at 12:28:57 UTC, zodd wrote: >> This code works as I expected but I'm unsure that it's correct. > > Yes, your code is legal. > > What isn't legal is using some type that isn't there at runtime, like > > union A { >

Re: built-in types inside of a union

2016-07-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:28:57 UTC, zodd wrote: This code works as I expected but I'm unsure that it's correct. Yes, your code is legal. What isn't legal is using some type that isn't there at runtime, like union A { int[] a; char[] b; } A u; u.a = [1,2]; u.b.length The

Re: aspects on methods?

2016-07-13 Thread Anonymouse via Digitalmars-d-learn
On Tuesday, 12 July 2016 at 11:26:20 UTC, jj75607 wrote: I want to use aspect-like annotations to transform [...] Two methods spring to mind but both create new types. You can either write a function that iterates through the members of your class, generating a string mixin that selectively

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 13, 2016 11:59:18 Miguel L via Digitalmars-d-learn wrote: > I am using a temporary dynamic array inside a loop this way: > A[] a; > for() > { > a=[]; //discard array contents > ... appends thousand of elements to a > ... use a for some calculations > } > > I would like to

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:37:26 UTC, Miguel L wrote: I tried Appender, but for some reason garbage collector still seems to be running every few iterations. I will try to expand a little on my code because maybe there is something i am missing: Appender!(A[]) a; void foo( out

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Miguel L via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:05:18 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 11:59:18 UTC, Miguel L wrote: I am using a temporary dynamic array inside a loop this way: A[] a; for() { a=[]; //discard array contents ... appends thousand of elements to a ... use a for

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Mathias Lang via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:05:12 UTC, rikki cattermole wrote: On 13/07/2016 11:59 PM, Miguel L wrote: The options would be: a=[]; a.length=0; a=null; ... any other? Can you help me please? All of those "options" do the same thing, remove all references to that data. No they don't.

built-in types inside of a union

2016-07-13 Thread zodd via Digitalmars-d-learn
Can I place a dynamic array, an associative array and a string to a union and work with all elements? They are built-in types, but actually not primitive ones (this is not allowed in C++ for example). That's why I'm in doubt. I'm trying to implement something close to variant type (with a few

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread cym13 via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:22:55 UTC, Lodovico Giaretta wrote: On Wednesday, 13 July 2016 at 12:20:07 UTC, cym13 wrote: The best option would be a.clear(). From the language specs: “Removes all remaining keys and values from an associative array. The array is not rehashed after removal,

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 12:20:07 UTC, cym13 wrote: The best option would be a.clear(). From the language specs: “Removes all remaining keys and values from an associative array. The array is not rehashed after removal, to allow for the existing storage to be reused. This will affect all

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread cym13 via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:59:18 UTC, Miguel L wrote: I am using a temporary dynamic array inside a loop this way: A[] a; for() { a=[]; //discard array contents ... appends thousand of elements to a ... use a for some calculations } I would like to know which would be the best way to

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread ketmar via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:59:18 UTC, Miguel L wrote: The options would be: a=[]; a.length=0; a=null; ... any other? it really depends of your other code. if you don't have any slices of the array, for example, you can use `a.length = 0; a.assumeSafeAppend;` -- this will reuse the

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:59:18 UTC, Miguel L wrote: I am using a temporary dynamic array inside a loop this way: A[] a; for() { a=[]; //discard array contents ... appends thousand of elements to a ... use a for some calculations } I would like to know which would be the best way to

Re: Best way to clear dynamic array for reuse

2016-07-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/07/2016 11:59 PM, Miguel L wrote: I am using a temporary dynamic array inside a loop this way: A[] a; for() { a=[]; //discard array contents ... appends thousand of elements to a ... use a for some calculations } I would like to know which would be the best way to clear a contents

Best way to clear dynamic array for reuse

2016-07-13 Thread Miguel L via Digitalmars-d-learn
I am using a temporary dynamic array inside a loop this way: A[] a; for() { a=[]; //discard array contents ... appends thousand of elements to a ... use a for some calculations } I would like to know which would be the best way to clear a contents avoiding reallocations, as there seems to

Re: I can has @nogc and throw Exceptions?

2016-07-13 Thread Lodovico Giaretta via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 00:57:38 UTC, Adam Sansier wrote: How about simply setting aside a 100kb of memory as a pool for exceptions. Seems like a lot but still under 640kb, hell, even 1MB would still be tiny. After all, it's not like exceptions are common or happen in complex ways.

Re: mismatch and return value

2016-07-13 Thread celavek via Digitalmars-d-learn
Thank you both for the very good insights. Community wise +1 :)

Re: mismatch and return value

2016-07-13 Thread ketmar via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:11:51 UTC, celavek wrote: I misunderstood the doc and I got a bit confused by the range - in C++ I would have incremented the iterators but here I did not know what to do exactly as I could not match the 2 different concepts in functionality. it mostly maps

Re: mismatch and return value

2016-07-13 Thread ketmar via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:13:00 UTC, Mike Parker wrote: To be fair, I think it's only obvious to someone who has achieved a certain level of comfort and familiarity with ranges and the range-based functions in Phobos. This particular function could just as easily be inferred to return

Re: mismatch and return value

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:11:51 UTC, celavek wrote: Thank you for the example. I misunderstood the doc and I got a bit confused by the range - in C++ I would have incremented the iterators but here I did not know what to do exactly as I could not match the 2 different concepts in

Re: mismatch and return value

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:10:11 UTC, ketmar wrote: On Wednesday, 13 July 2016 at 11:06:56 UTC, celavek wrote: On Wednesday, 13 July 2016 at 10:41:44 UTC, ketmar wrote: I understand your point but it should not be a matter of guessing. It should be explicitly stated by the

Re: mismatch and return value

2016-07-13 Thread celavek via Digitalmars-d-learn
Thank you for the example. I misunderstood the doc and I got a bit confused by the range - in C++ I would have incremented the iterators but here I did not know what to do exactly as I could not match the 2 different concepts in functionality.

Re: mismatch and return value

2016-07-13 Thread ketmar via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 11:06:56 UTC, celavek wrote: On Wednesday, 13 July 2016 at 10:41:44 UTC, ketmar wrote: I understand your point but it should not be a matter of guessing. It should be explicitly stated by the documentation. then people will start to complain that documentation

Re: mismatch and return value

2016-07-13 Thread celavek via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 10:41:44 UTC, ketmar wrote: let's read the doc again: "Returns a tuple with the reduced ranges that start with the two mismatched values." simple logic allows us to guess that it should return tuple with two empty ranges. and it really does. I understand your

Re: mismatch and return value

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 09:59:30 UTC, celavek wrote: Hi, I am trying to use the function "mismatch" from std.algorithm.comparison like so: int count = 0; auto m = mismatch(lhs, rhs); while (!m[0].empty) { ++count; m = mismatch(m[0], m[1]); } That goes into an infinite loop.

Re: mismatch and return value

2016-07-13 Thread ketmar via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 09:59:30 UTC, celavek wrote: That goes into an infinite loop. sure. let's read the docs: "Returns a tuple with the reduced ranges that start with the two mismatched values." so, if it will find mismatch, it will loop forever then, as you forgot to pop one of

Re: mismatch and return value

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 09:59:30 UTC, celavek wrote: As a side note the documentation of the standard library is not digestible to say the least - there is missing info(e.g. what does mismatch return if no mismatch found) and lacks user-friendliness and details. Whenever you find

mismatch and return value

2016-07-13 Thread celavek via Digitalmars-d-learn
Hi, I am trying to use the function "mismatch" from std.algorithm.comparison like so: int count = 0; auto m = mismatch(lhs, rhs); while (!m[0].empty) { ++count; m = mismatch(m[0], m[1]); } That goes into an infinite loop. What does mismatch return when it cannot actually find a

Re: C++ interface vs D and com

2016-07-13 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 07:31:57 UTC, Adam Sansier wrote: void** ptr = null; auto res = CoCreateInstance(_ID, cast(IUnknown)null, CLSCTX_INPROC_SERVER, _ID, cast(void**)); See the example above. IUnknown ptr = null; auto res = CoCreateInstance(, null,

Re: C++ interface vs D and com

2016-07-13 Thread John via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 07:31:57 UTC, Adam Sansier wrote: void** ptr = null; auto res = CoCreateInstance(_ID, cast(IUnknown)null, CLSCTX_INPROC_SERVER, _ID, cast(void**)); How are you casting your "ptr" variable (which BTW should be just void* or usually IUnknown) to your

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 06:44:36 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 03:38:03 UTC, Mike Parker wrote: On Wednesday, 13 July 2016 at 02:49:54 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 02:34:14 UTC, Mike Parker wrote: What happens when you declare an

Re: C++ interface vs D and com

2016-07-13 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 06:44:36 UTC, Adam Sansier wrote: Regardless of what you think, I can prove that the code won't work when it is marked extern(Windows) and works when it is marked extern (C++)... so what you should be asking yourself is why it is doing that rather than assuming

Re: C++ interface vs D and com

2016-07-13 Thread Adam Sansier via Digitalmars-d-learn
On Wednesday, 13 July 2016 at 03:38:03 UTC, Mike Parker wrote: On Wednesday, 13 July 2016 at 02:49:54 UTC, Adam Sansier wrote: On Wednesday, 13 July 2016 at 02:34:14 UTC, Mike Parker wrote: What happens when you declare an interface that extends from IUnknown (and not extern(C++)), then cast