Re: multidimensional array

2014-09-30 Thread Joel via Digitalmars-d-learn
Thanks JKPdouble. I was hoping for a clear way to work multidimensional arrays out.

Re: DirectX 11 bindings?

2014-09-30 Thread Denis Gladkiy via Digitalmars-d-learn
http://www.dsource.org/projects/bindings/browser/trunk/directx On Sunday, 8 August 2010 at 15:13:19 UTC, Trass3r wrote: Are there any bindings for DirectX 11? The bindings project only contains DX9 and DX10.

Re: DirectX 11 bindings?

2014-09-30 Thread evilrat via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 13:05:56 UTC, Denis Gladkiy wrote: http://www.dsource.org/projects/bindings/browser/trunk/directx On Sunday, 8 August 2010 at 15:13:19 UTC, Trass3r wrote: Are there any bindings for DirectX 11? The bindings project only contains DX9 and DX10. better check

Re: find all public properties at compile time

2014-09-30 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 29 September 2014 at 20:21:43 UTC, gedaiu wrote: Hi, There is a way to determine all public properties (not methods) from a struct/class at compile time? I seen that there are traits to get only methods but not properties. Am I wrong? thanks, Bogdan You can get the function

Re: How do you get T from shared(T) ?

2014-09-30 Thread John Colvin via Digitalmars-d-learn
On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote: For head-unshared there is `static if (is(T U : shared U))`. But how do you get the unshared type for anything from `shared void*` to `shared uint` ? template UnShared(T, bool removeAll = false) { static if(is(T : shared U,

Initialising multidimensional dynamic arrays

2014-09-30 Thread Mike James via Digitalmars-d-learn
Hi, How do I initialise a dynamic array of dynamic arrays? struct MyData { SysTime stamp; short[] data; this(size_t size) { data = new short[size]; } } MyDataArray mda; how to initialise mda? mda = new MyDataArray ? Thanks. Regards, -=mike=-

Re: Initialising multidimensional dynamic arrays

2014-09-30 Thread ketmar via Digitalmars-d-learn
On Tue, 30 Sep 2014 15:57:57 + Mike James via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: How do I initialise a dynamic array of dynamic arrays? do you mean something like this: `int[][] a`? if yes, do this: auto a = new int[][](42, 69); and you'll get `int[42][69] a`.

Re: Initialising multidimensional dynamic arrays

2014-09-30 Thread Mike James via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 16:07:28 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 30 Sep 2014 15:57:57 + Mike James via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: How do I initialise a dynamic array of dynamic arrays? do you mean something like this:

Re: Initialising multidimensional dynamic arrays

2014-09-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/30/14 12:40 PM, Mike James wrote: On Tuesday, 30 September 2014 at 16:07:28 UTC, ketmar via Digitalmars-d-learn wrote: auto a = new int[][](42, 69); ... You'll notice that it's actually a dynamic array of structs containing dynamic arrays - does this change your initializing?

What is a sink delegate?

2014-09-30 Thread Gary Willoughby via Digitalmars-d-learn
What is a sink delegate? Discussed here: http://forum.dlang.org/thread/m0bdgg$1t7j$1...@digitalmars.com?page=6#post-m0emvc:242av5:241:40digitalmars.com

Re: What is a sink delegate?

2014-09-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 17:22:44 UTC, Gary Willoughby wrote: What is a sink delegate? Instead of string toString() { return foo; } for example, you would use: void toString(void delegate(string) sink) { sink(foo); } The sink argument there is then free to view and discard the data

Re: is there any reason UFCS can't be used with 'new'?

2014-09-30 Thread Nordlöw
On Sunday, 28 September 2014 at 20:28:11 UTC, Jay wrote: fwiw here's what i wrote: template New(T) if (is(T == class)) { T New(Args...) (Args args) { return new T(args); } } My try template New(T) if (is(T == class)) { T New(Args...) (Args args) { return new

Re: What is a sink delegate?

2014-09-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/30/14 1:22 PM, Gary Willoughby wrote: What is a sink delegate? Discussed here: http://forum.dlang.org/thread/m0bdgg$1t7j$1...@digitalmars.com?page=6#post-m0emvc:242av5:241:40digitalmars.com Aside from Adam's answer, the term 'sink' means to draw out something, as in 'heat sink'. So

Re: Non-const std.container.Array.opIndex and alikes blocks serialization

2014-09-30 Thread Nordlöw
On Sunday, 28 September 2014 at 20:27:32 UTC, monarch_dodra wrote: This is the whole function attributes on left side confusion - fiasco thing... https://github.com/D-Programming-Language/phobos/pull/2573

Re: is there any reason UFCS can't be used with 'new'?

2014-09-30 Thread Ali Çehreli via Digitalmars-d-learn
On 09/30/2014 10:35 AM, Nordlöw wrote: On Sunday, 28 September 2014 at 20:28:11 UTC, Jay wrote: fwiw here's what i wrote: template New(T) if (is(T == class)) { T New(Args...) (Args args) { return new T(args); } } My try template New(T) if (is(T == class)) { T

Re: is there any reason UFCS can't be used with 'new'?

2014-09-30 Thread Ali Çehreli via Digitalmars-d-learn
On 09/30/2014 11:07 AM, Ali Çehreli wrote: To make a nested class unnested, declare it as static, which seems to work in your case as well: class C { int x, y; } auto x = New!C(); Copy+paste cannot read my mind. :( Of course there should be 'static' keyword there. :p

Re: is there any reason UFCS can't be used with 'new'?

2014-09-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/30/14 2:07 PM, Ali Çehreli wrote: Apparently, a class definition even inside a unittest blocks are considered to be nested classes. Normally, objects of nested classes are created by the 'this.new' syntax, 'this' meaning the object that wraps the nested class. I think unit test blocks

Re: find all public properties at compile time

2014-09-30 Thread gedaiu via Digitalmars-d-learn
Thank you for your response! I don't think that it helps me... I wanted to get an array like this [ a, b, c ] for this class class test { } Bogdan On Tuesday, 30 September 2014 at 14:20:04 UTC, Rene Zwanenburg wrote: On Monday, 29 September 2014 at 20:21:43 UTC, gedaiu wrote: Hi,

Re: find all public properties at compile time

2014-09-30 Thread gedaiu via Digitalmars-d-learn
[sorry... this is the edit for the prev post] Thank you for your response! I don't think that it helps me... I wanted to get an array like this [ a, b, c ] for this class class test { int a; string b; double c; } Bogdan On Tuesday, 30 September 2014 at 14:20:04 UTC, Rene Zwanenburg

Re: find all public properties at compile time

2014-09-30 Thread anonymous via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 20:04:29 UTC, gedaiu wrote: [sorry... this is the edit for the prev post] Thank you for your response! I don't think that it helps me... I wanted to get an array like this [ a, b, c ] for this class class test { int a; string b; double c; } import

Re: find all public properties at compile time

2014-09-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-09-30 22:19, anonymous wrote: import std.typetuple: staticMap; enum stringOf(alias thing) = thing.stringof; It's better to use __traits(identifier) instead of .stringof. -- /Jacob Carlborg

Opening dub packages in Mono-D

2014-09-30 Thread Phil via Digitalmars-d-learn
I'm trying to use Mono-D, but can't work out how to do simple things. I've tried looking for tutorials but this http://wiki.dlang.org/Mono-D is all I could find. I want to reference Pegged from a Mono-D project. I can't add its package.json as a project to my solution as I'm told that this

Re: Opening dub packages in Mono-D

2014-09-30 Thread evilrat via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 21:47:01 UTC, Phil wrote: I'm trying to use Mono-D, but can't work out how to do simple things. I've tried looking for tutorials but this http://wiki.dlang.org/Mono-D is all I could find. I want to reference Pegged from a Mono-D project. I can't add its