Re: Simple template constraint question

2015-09-19 Thread anonymous via Digitalmars-d-learn
On Saturday 19 September 2015 19:09, WhatMeWorry wrote: > And a more open ended question. Is there a more elegant solution > for the > below function? Maybe a one-liner? I have a knack for making > simple solutions > complex :) > > > > // Calculate the number of components for openGL

Re: Contracts with interface

2015-09-19 Thread BBasile via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:33:12 UTC, tchaloupka wrote: This bites me again: import std.stdio; interface ITest { void test(); void test2() in { writeln("itest2"); } void test3() in { writeln("itest3"); } void test4() in { writeln("itest4");

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread anonymous via Digitalmars-d-learn
On Sunday 20 September 2015 00:09, Random D user wrote: > class Gui > { > enum MouseButton { Left = 0, Right }; > > private: > > struct ClickPair > { > MouseButton button = MouseButton.Left; > }; > > struct ClickPair // Second struct ClickPair with the enum

text wrap

2015-09-19 Thread Joel via Digitalmars-d-learn
What is simple way to wrap a string into strings? Eg from: I went for a walk and fell down a hole. To (6 max width): I went for a walk and fell down a hole.

Re: text wrap

2015-09-19 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:22:17 UTC, Joel wrote: What is simple way to wrap a string into strings? Eg from: I went for a walk and fell down a hole. To (6 max width): I went for a walk and fell down a hole. http://dlang.org/phobos/std_string.html#.wrap

Re: This is probably trivial or impossible Code Introspection...

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 19 September 2015 at 19:54:45 UTC, Adam D. Ruppe wrote: On Saturday, 19 September 2015 at 19:52:56 UTC, WhatMeWorry wrote: So I've got type and value of each member, but I want their actual names? http://dlang.org/phobos/std_traits.html#FieldNameTuple You can also do something

Re: Templated opIndex?

2015-09-19 Thread Ali Çehreli via Digitalmars-d-learn
On 09/19/2015 02:33 AM, OlaOst wrote: > Here is a class with a templated opIndex method, and an attempt to use it: > > class Test > { > int[] numbers = [1, 2, 3]; > string[] texts = ["a", "b", "c"]; > > Type opIndex(Type)(int index) > { > static if (is(Type == int))

Re: This is probably trivial or impossible Code Introspection...

2015-09-19 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Sep 20, 2015 at 05:21:03AM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] > Thanks. But now I have an even more fundamental problem. I keep > getting a FieldNameTuple is not defined. But I've clearly got the > import statement. I even copied the example from Phobos verbatim:

Re: This is probably trivial or impossible Code Introspection...

2015-09-19 Thread Ali Çehreli via Digitalmars-d-learn
On 09/19/2015 10:21 PM, WhatMeWorry wrote: On Saturday, 19 September 2015 at 19:54:45 UTC, Adam D. Ruppe wrote: On Saturday, 19 September 2015 at 19:52:56 UTC, WhatMeWorry wrote: So I've got type and value of each member, but I want their actual names?

Re: This is probably trivial or impossible Code Introspection...

2015-09-19 Thread Ali Çehreli via Digitalmars-d-learn
On 09/19/2015 10:30 PM, H. S. Teoh via Digitalmars-d-learn wrote: On Sun, Sep 20, 2015 at 05:21:03AM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] Thanks. But now I have an even more fundamental problem. I keep getting a FieldNameTuple is not defined. But I've clearly got the

How can a value of a constant be varied through a pointer ?

2015-09-19 Thread RADHA GOGIA via Digitalmars-d-learn
I went through these two links and found that this behaviour is undefined , but the only issue which I have is that in one sense we say that since local variables live on stack , hence they cannot be located on read only memory region but if this is so then if I try to alter the value of the

Re: I'll like to learn D

2015-09-19 Thread DlangLearner via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:42:50 UTC, uNknow123 wrote: On Saturday, 19 September 2015 at 15:09:38 UTC, WhatMeWorry wrote: On Saturday, 19 September 2015 at 13:41:03 UTC, uNknow123 wrote: Hi! I'll like to learn D Lang. I knew some Pawn, it is pretty similar, but not so similar, if you

Re: This is probably trivial or impossible Code Introspection...

2015-09-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 19 September 2015 at 19:52:56 UTC, WhatMeWorry wrote: So I've got type and value of each member, but I want their actual names? http://dlang.org/phobos/std_traits.html#FieldNameTuple You can also do something like `foo.tupleof[idx]["foo.".length .. $]` for an individual thing

This is probably trivial or impossible Code Introspection...

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
given some struct: writeln("face.glyph.bitmap = ", face.glyph.bitmap); which displays the following: face.glyph.bitmap = FT_Bitmap(30, 25, 25, 4105948, 256, 2, 0, null) Is there a way for D to display the variable names within the FT_Bitmap? For instance, the following code snippet

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread Random D user via Digitalmars-d-learn
On Saturday, 19 September 2015 at 07:25:58 UTC, ponce wrote: On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote: So I tried to build my project in release for the first time in a long while. It takes like 25x longer to compile and finally the compiler crashes. It seems to go

Re: text wrap

2015-09-19 Thread Doxin via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:22:17 UTC, Joel wrote: What is simple way to wrap a string into strings? Eg from: I went for a walk and fell down a hole. To (6 max width): I went for a walk and fell down a hole. a common method works as follows. first you split your string into chunks

Re: text wrap

2015-09-19 Thread Joel via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:22:17 UTC, Joel wrote: What is simple way to wrap a string into strings? Eg from: I went for a walk and fell down a hole. To (6 max width): I went for a walk and fell down a hole. Actually, I did a search and found this. import std.string.wrap;

How do you handle OutOfMemoryError?

2015-09-19 Thread Enjoys Math via Digitalmars-d-learn
Here's my code: https://drive.google.com/file/d/0B3LYxKGJ4ZI_MV91SkxPVVlSOW8/view?usp=sharing I don't have access to a debugger. Run the code for a few minutes and it tends to crash with a core OutOfMemoryError. Any suggestions welcome including regularly cleaning up memory used. Thanks.

Re: text wrap

2015-09-19 Thread Doxin via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:28:23 UTC, Doxin wrote: I'll get to work on some example code. here you go: http://dpaste.dzfl.pl/e6e715c54c1b do mind that this code has a couple issues, for example handing it a word longer than the break width will make it loop infinitely. word wrap

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread Random D user via Digitalmars-d-learn
On Saturday, 19 September 2015 at 21:48:25 UTC, Random D user wrote: Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this' on line 957 in file 'struct.c' Ok managed to reduce this one to my own copy paste bug. This is invalid code, but compiler shouldn't crash... I'm

Re: How can a value of a constant be varied through a pointer ?

2015-09-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:09:52 UTC, RADHA GOGIA wrote: I went through these two links and found that this behaviour is undefined , but the only issue which I have is that in one sense we say that since local variables live on stack , hence they cannot be located on read only memory

Re: Simple template constraint question

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:18:23 UTC, Daniel Kozak wrote: WhatMeWorry píše v So 19. 09. 2015 v 17:09 +: [...] http://dlang.org/expression.html#IsExpression 3. is ( Type == TypeSpecialization ) import std.stdio; struct S { } class C { } void f(T)(T someStruct) if (is (T ==

Re: Anybody use Derelict FreeType recently (successfully)

2015-09-19 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 19 September 2015 at 15:01:06 UTC, WhatMeWorry wrote: Sorry, meant to get back but got busy. Yes, works great! Thanks! Not sure why I had so much trouble finding a freetype.dll library. Had no problems with OpenAL and FreeImage. I'm curious how you compiled the DLL that

Re: Get AA key and value type

2015-09-19 Thread Marc Schütz via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote: Hi everybody, I would like to extract key and value type from AA. You can also do it with built-in syntax: template AATypes(AA : K[V], K, V) { alias Key = K; alias Value = V; }

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:41:39 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread ponce via Digitalmars-d-learn
On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote: So I tried to build my project in release for the first time in a long while. It takes like 25x longer to compile and finally the compiler crashes. It seems to go away if I disable the optimizer. I get: tym = x1d Internal

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote: So I tried to build my project in release for the first time in a long while. It takes like 25x longer to compile and finally the compiler crashes. It seems to go away if I disable the optimizer. I get: tym = x1d Internal

Re: How do you get the min / max of two numbers a, b?

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 03:53:12 UTC, Enjoys Math wrote: I know there's fmax for floats, but what about ints? Thanks. http://p0nce.github.io/d-idioms/#Minimum-or-maximum-of-numbers

Re: broken program, silly error messages, dub

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 01:54:08 UTC, Joel wrote: I accidentally wiped off a small source file. I've been trying to put it back together. Now I get unrelated errors. I've tried resetting dub. To reset DUB state completely: - remove .dub/ directory in the project directory -

Re: broken program, silly error messages, dub

2015-09-19 Thread Joel via Digitalmars-d-learn
On Saturday, 19 September 2015 at 07:24:01 UTC, ponce wrote: On Saturday, 19 September 2015 at 01:54:08 UTC, Joel wrote: I accidentally wiped off a small source file. I've been trying to put it back together. Now I get unrelated errors. I've tried resetting dub. To reset DUB state

Re: Why do abstract class functions require definitions?

2015-09-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-09-18 17:45, Jakob Ovrum wrote: That's `export`. Right, my bad. D has too many attributes :) -- /Jacob Carlborg

Re: broken program, silly error messages, dub

2015-09-19 Thread Joel via Digitalmars-d-learn
On Saturday, 19 September 2015 at 08:33:05 UTC, Joel wrote: On Saturday, 19 September 2015 at 07:24:01 UTC, ponce wrote: On Saturday, 19 September 2015 at 01:54:08 UTC, Joel wrote: I accidentally wiped off a small source file. I've been trying to put it back together. Now I get unrelated

Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta) { Runtime.initialize(); const pi = 4.0 * delta * reduce!(

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). [...] I heard it crashed during the talk. Bummer. I should really be there, seeing as I

Re: Templated opIndex?

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 09:33:02 UTC, OlaOst wrote: Here is a class with a templated opIndex method, and an attempt to use it: class Test { int[] numbers = [1, 2, 3]; string[] texts = ["a", "b", "c"]; Type opIndex(Type)(int index) {

Re: Get AA key and value type

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote: So how can I get types without instance ? Thanks for help. -->8- template AATypes(T) { // todo: static assert if T is no AA type here alias ArrayElementType!(typeof(T.init.keys)) key; alias

Templated opIndex?

2015-09-19 Thread OlaOst via Digitalmars-d-learn
Here is a class with a templated opIndex method, and an attempt to use it: class Test { int[] numbers = [1, 2, 3]; string[] texts = ["a", "b", "c"]; Type opIndex(Type)(int index) { static if (is(Type == int))

Contracts with interface

2015-09-19 Thread tchaloupka via Digitalmars-d-learn
This bites me again: import std.stdio; interface ITest { void test(); void test2() in { writeln("itest2"); } void test3() in { writeln("itest3"); } void test4() in { writeln("itest4"); assert(false); } } class Test: ITest { void test() in {

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Get AA key and value type

2015-09-19 Thread Pierre via Digitalmars-d-learn
Hi everybody, I would like to extract key and value type from AA. I found this answer on forum : template AATypes(T) { // todo: static assert if T is no AA type here alias ArrayElementType!(typeof(T.keys)) key; alias ArrayElementType!(typeof(T.values)) value; } But compiler failed,I

I'll like to learn D

2015-09-19 Thread uNknow123 via Digitalmars-d-learn
Hi! I'll like to learn D Lang. I knew some Pawn, it is pretty similar, but not so similar, if you understan me. In Pawn we have to write just some words, and the Plugin is done, why Plugin, 'cuse Pawn = Scripting for Cs 1.6 and Sa:Mp. So, I am a rookie, can you help me please?

Re: Templated opIndex?

2015-09-19 Thread OlaOst via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:16:58 UTC, John Colvin wrote: On Saturday, 19 September 2015 at 09:33:02 UTC, OlaOst wrote: [...] 2 approaches: 1) use a function instead. E.g. test.get!int(0); isn't too bad 2) If you really want to use [], do something like this: [...] Thanks, option

Re: Templated opIndex?

2015-09-19 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
And this: class TestInt: Test { alias opIndex = super.opIndex!int; } class TestString: Test { alias opIndex = super.opIndex!string; }

Re: Templated opIndex?

2015-09-19 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
And this? auto ref qua(T)(Test t){ struct wrap { Test t; T opIndex(int i){ return t.opIndex!T(i); } } return wrap(t); } void main() { auto test = new Test(); writeln(test.qua!string[0], test.qua!int[0]); }

Re: Anybody use Derelict FreeType recently (successfully)

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 18 September 2015 at 16:34:16 UTC, BBasile wrote: On Friday, 18 September 2015 at 00:13:41 UTC, BBasile wrote: On Thursday, 17 September 2015 at 22:22:22 UTC, WhatMeWorry wrote: [...] After hours of reading existing freetype/derelict documents, I'm stuck again. Any suggestions.

Re: I'll like to learn D

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 19 September 2015 at 13:41:03 UTC, uNknow123 wrote: Hi! I'll like to learn D Lang. I knew some Pawn, it is pretty similar, but not so similar, if you understan me. In Pawn we have to write just some words, and the Plugin is done, why Plugin, 'cuse Pawn = Scripting for Cs 1.6 and

Re: Get AA key and value type

2015-09-19 Thread Pierre via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:52:19 UTC, ponce wrote: On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote: So how can I get types without instance ? Thanks for help. -->8- template AATypes(T) { // todo: static assert if T is no AA type here alias

Re: Simple template constraint question

2015-09-19 Thread Daniel Kozak via Digitalmars-d-learn
WhatMeWorry píše v So 19. 09. 2015 v 17:09 +: > Does D provide complete template constraint granularity? > > In other words, I want to only accept structs in the template > below. > I've find the isAggregateType which is close but no cigar. Am I > missing > some other filters? > > And a

Re: What's wrong with this code?

2015-09-19 Thread Chris via Digitalmars-d-learn
On Saturday, 19 September 2015 at 02:45:54 UTC, Adam D. Ruppe wrote: On Saturday, 19 September 2015 at 02:30:39 UTC, Chris wrote: bmove.addOnClicked (delegate void (Button aux) { What's the context of this call? If it is inside a struct and you are accessing local

Re: What's wrong with this code?

2015-09-19 Thread Chris via Digitalmars-d-learn
Update: If I add *also* a auto vec2 = vec; now the code works. So it looks like this now: voxel_vec [string] move_buttons = [ "button_xp" : voxel_vec ([ 1, 0, 0 ]), "button_xm" : voxel_vec ([ -1, 0, 0 ]),

Re: I'll like to learn D

2015-09-19 Thread uNknow123 via Digitalmars-d-learn
On Saturday, 19 September 2015 at 15:09:38 UTC, WhatMeWorry wrote: On Saturday, 19 September 2015 at 13:41:03 UTC, uNknow123 wrote: Hi! I'll like to learn D Lang. I knew some Pawn, it is pretty similar, but not so similar, if you understan me. In Pawn we have to write just some words, and the

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: text wrap

2015-09-19 Thread Joel via Digitalmars-d-learn
On Sunday, 20 September 2015 at 00:48:39 UTC, Doxin wrote: On Sunday, 20 September 2015 at 00:28:23 UTC, Doxin wrote: I'll get to work on some example code. here you go: http://dpaste.dzfl.pl/e6e715c54c1b do mind that this code has a couple issues, for example handing it a word longer than

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 12:21 +, ponce via Digitalmars-d-learn wrote: > […] > > Try using an explicit TaskPool and destroying it with scope(exit). > > > Also if using LDC, you can use global ctor/dtor to deal with the > runtime. > > > --->8- > >

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 15:58 +, ponce via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder > wrote: > > > > Hummm… I now do not get a segfault, and the code runs as > > expected : > > -) but the program never terminates. :-( > > Where is it

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 11:07 +, John Colvin via Digitalmars-d-learn wrote: > […] > I heard it crashed during the talk. Bummer. I should really be > there, seeing as I live about 15 mins away. If you get a chance > to talk to Alex Bishop, don't be too harsh on D to him, I'm > trying to

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth.

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 17:15 +0100, Russel Winder wrote: > […] > Sadly the: > > pragma(LDC_global_crt_ctor, 0) > void initRuntime() { > import core.runtime: Runtime; > Runtime.initialize(); >} > > will not compile under DMD :-( On the otherhand using a: version(LDC) {

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder wrote: Sadly the: pragma(LDC_global_crt_ctor, 0) void initRuntime() { import core.runtime: Runtime; Runtime.initialize(); } will not compile under DMD :-( version(LDC){ /* ... */ } not that it helps make

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:33 +, John Colvin via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder > wrote: > > Sadly the: > > > > pragma(LDC_global_crt_ctor, 0) > > void initRuntime() { > > import core.runtime: Runtime; > >

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:32:18 UTC, Russel Winder wrote: (*) ponce is arguably not the most positive or constructive name to go by. Friend call me like this IRL since forever. It seems to be a swear word in english?

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:34:05 UTC, John Colvin wrote: On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell,

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder wrote: Hummm… I now do not get a segfault, and the code runs as expected : -) but the program never terminates. :-( Where is it stuck? Also, what would I need to cover the DMD and the GDC situations? I don't know. :(

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth. Would like to know too. On OSX I've found that shared static this()

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:25 +, Laeeth Isharc via Digitalmars-d -learn wrote: > […] > What is the difference between shared static this and the global > constructor ? Russell, if you use shared static this for dmd > does it work ? Laeeth. I had no idea what to put in a: shared static

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:41 +, ponce via Digitalmars-d-learn wrote: > […] > Friend call me like this IRL since forever. > > It seems to be a swear word in english? English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South

Simple template constraint question

2015-09-19 Thread WhatMeWorry via Digitalmars-d-learn
Does D provide complete template constraint granularity? In other words, I want to only accept structs in the template below. I've find the isAggregateType which is close but no cigar. Am I missing some other filters? And a more open ended question. Is there a more elegant solution for