Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:33:36 UTC, moe wrote: I see where I went wrong. I thought that it's possible to only use the .lib file without the source code of dbar. Having access to the source makes what I am trying somewhat pointless. Is it otherwise possible to provide some functionality

Re: Using .lib and .dll in D applications

2016-06-19 Thread captaindet via Digitalmars-d-learn
On 2016-06-20 06:33, moe wrote: I see where I went wrong. I thought that it's possible to only use the .lib file without the source code of dbar. Having access to the source makes what I am trying somewhat pointless. Is it otherwise possible to provide some functionality without having to give

Re: Using .lib and .dll in D applications

2016-06-19 Thread docandrew via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:33:36 UTC, moe wrote: On Sunday, 19 June 2016 at 18:00:07 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in

Re: What exactly does the compiler switch -betterC do?

2016-06-19 Thread docandrew via Digitalmars-d-learn
On Sunday, 19 June 2016 at 19:53:46 UTC, Gary Willoughby wrote: When compiling, what exactly does the -betterC flag do? The command help says "omit generating some runtime information and helper functions" but what does this really mean? Is there any specifics somewhere? My understanding was

Re: D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 23:00:03 UTC, ag0aep6g wrote: On 06/19/2016 11:19 PM, Joerg Joergonson wrote: On Sunday, 19 June 2016 at 20:21:35 UTC, ag0aep6g wrote: [...] No. B!b is derived from A!b, not from A!a. `b` being derived from `a` does not make A!b derived from A!a. why not? This

Re: Can anybody install DDT on Eclipse Neon or Mars?

2016-06-19 Thread bachmeier via Digitalmars-d-learn
On Saturday, 18 June 2016 at 16:46:26 UTC, Mark wrote: I've spent may hours trying to do this in OSX. Everything goes fine from the marketplace window...until I restart Eclipse and find no files have been added? Any words of consolation or advice will be greatly appreciated. Desperately,

Re: Can anybody install DDT on Eclipse Neon or Mars?

2016-06-19 Thread crimaniak via Digitalmars-d-learn
On Saturday, 18 June 2016 at 16:46:26 UTC, Mark wrote: I've spent may hours trying to do this in OSX. Everything goes fine from the marketplace window...until I restart Eclipse and find no files have been added? Any words of consolation or advice will be greatly appreciated. I have Eclipse

Re: D casting broke?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 11:19 PM, Joerg Joergonson wrote: On Sunday, 19 June 2016 at 20:21:35 UTC, ag0aep6g wrote: [...] No. B!b is derived from A!b, not from A!a. `b` being derived from `a` does not make A!b derived from A!a. why not? This doesn't seem logical! Template parameters simply don't work

const and mutable opApply's

2016-06-19 Thread Oleg B via Digitalmars-d-learn
Hello struct WTable { ... private enum opApply_body = q{ if( smt ) { foreach( f; 0 .. size-1 ) foreach( t; f+1 .. size ) if( auto r = dlg(f,t,data[getIndex(f,t)]) ) return r; } else {

Re: D casting broke?

2016-06-19 Thread David Nadlinger via Digitalmars-d-learn
On Sunday, 19 June 2016 at 21:06:43 UTC, Joerg Joergonson wrote: A!b is derived from A!a if b is derived from a, is it not? If not, then I am wrong, if so then D casting has a bug. You are wrong. The array example given by Adam is actually a neat illustration of precisely your question if

Re: D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 20:21:35 UTC, ag0aep6g wrote: On 06/19/2016 09:59 PM, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly ok and we see that T' derives from b which derives from a directly. ok So B!b is an entirely derived

Re: D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 20:18:14 UTC, Adam D. Ruppe wrote: On Sunday, 19 June 2016 at 19:59:28 UTC, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly and we see that T' derives from b which derives from a directly. So B!b is an entirely

Re: D casting broke?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 09:59 PM, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly ok and we see that T' derives from b which derives from a directly. ok So B!b is an entirely derived from A!a No. B!b is derived from A!b, not from A!a. `b`

Re: D casting broke?

2016-06-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 19:59:28 UTC, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly and we see that T' derives from b which derives from a directly. So B!b is an entirely derived from A!a and hence the cast should be successful I

D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
import std.stdio; class X { X Parent; } class x : X { } class a : x { void Do() { auto p = cast(A!a)(this.Parent); // works as long as we are in A assert(p !is null); } } class A(T : a) : X { X Parent = new X(); T _y = new T(); } class b : a { } class

What exactly does the compiler switch -betterC do?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
When compiling, what exactly does the -betterC flag do? The command help says "omit generating some runtime information and helper functions" but what does this really mean? Is there any specifics somewhere?

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 19, 2016 15:59:41 Joerg Joergonson via Digitalmars-d-learn wrote: > If foreach removes all/any of the elements of a container then > something is broke. That's exactly what happens with a basic input range, and if it doesn't happen with a forward range, it's just because copying

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:00:07 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo". Assuming that "dfoo" has no

Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo". Assuming that "dfoo" has no access to "dbar" other than the .lib file. You can't do it

Re: ARSD PNG memory usage

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
Also, for some reason one image has a weird horizontal line at the bottom of the image that is not part of the original. This is as if the height was 1 pixel to much and it's reading "junk". I have basically a few duplicate images that were generated from the same base image. None of the

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: On Sunday, 19 June 2016 at 16:31:40 UTC, Mike Parker wrote: [...] Thanks for the reply. Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo".

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 16:31:40 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 15:35:04 UTC, moe wrote: I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to

Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 15:35:04 UTC, moe wrote: I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to use a .lib file in an app. However, I can not use a module

Re: ARSD PNG memory usage

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Saturday, 18 June 2016 at 02:17:01 UTC, Adam D. Ruppe wrote: I have an auto generator for pngs and 99% of the time it works, but every once in a while I get an error when loading the png's. Usually re-running the generator "fixes the problem" so it might be on my end. Regardless of where

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:10:54 UTC, Jonathan M Davis wrote: On Saturday, June 18, 2016 21:55:31 Joerg Joergonson via Digitalmars-d-learn wrote: I wanted to switch to std.container.Array but it doesn't seem to mimic [] for some odd ball reason. D's dynamic arrays are really quite weird in

Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
Hello, I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to use a .lib file in an app. However, I can not use a module from the .lib file. I get the following

Re: Templated class defaults and inheritence

2016-06-19 Thread Rene Zwanenburg via Digitalmars-d-learn
On Saturday, 18 June 2016 at 17:48:47 UTC, Joerg Joergonson wrote: class foo(T) if (is(T : subfoo)) X; FYI this can also be done in the template parameter list: class foo(T : subfoo){}

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 12:45 PM, Gary Willoughby wrote: On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: import core.stdc.stdlib; import std.traits; ref T foo(T)() { alias Type = Unqual!(T); Type* foo = cast(Type*) malloc(Type.sizeof * 8);

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:45:25 UTC, Gary Willoughby wrote: On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: In the second example, the problem is this: alias Type = Unqual!(T); You are declaring the function to return T, which in your

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: import core.stdc.stdlib; import std.traits; ref T foo(T)() { alias Type = Unqual!(T); Type* foo = cast(Type*) malloc(Type.sizeof * 8); return *foo; } void main(string[]

Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
In the following code, the `foo` function doesn't work when casting to an immutable or shared type. Can anyone please explain what is happening here? Is there any way of returning such variables byRef from a malloc'd chunk of memory? import core.stdc.stdlib; ref T foo(T)() { int* foo

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 18, 2016 21:55:31 Joerg Joergonson via Digitalmars-d-learn wrote: > I wanted to switch to std.container.Array but it doesn't seem to > mimic [] for some odd ball reason. D's dynamic arrays are really quite weird in that they're sort of containers and sort of not. So, pretty

Re: Dub generate visuald, multiple configurations?

2016-06-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 19 June 2016 at 07:25:29 UTC, Tofu Ninja wrote: On Friday, 17 June 2016 at 08:49:47 UTC, Tofu Ninja wrote: Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to

Re: Dub generate visuald, multiple configurations?

2016-06-19 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 June 2016 at 08:49:47 UTC, Tofu Ninja wrote: Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to generate a separate project for each configuration? I am