Re: retrieving key and value type of an associative array (D1)

2011-02-24 Thread Funog
Le 23/02/2011 18:36, bearophile a écrit : Funog: In the case of an associative array, is it possible to retrieve both the value and key type? (D1) template AAKeyType(T) { alias typeof(T.keys[0]) AAKeyType; } template AAValType(T) { alias typeof(T.values[0]) AAValType; } Bye

Re: retrieving key and value type of an associative array (D1)

2011-02-24 Thread Funog
Le 24/02/2011 13:17, bearophile a écrit : Funog: Thanks ^^ But I actually asked my question wrong ; I also need to check whether abc is an associative array or not. Adapted from the module tango.core.Traits: template IsAA(T) { const bool IsAA = is( typeof(T.init.values[0])[typeof

retrieving key and value type of an associative array (D1)

2011-02-23 Thread Funog
static if ( is(abc U : U[]) ) ... aliases U to whatever abc is an array of. In the case of an associative array, is it possible to retrieve both the value and key type? (D1)

running an external .exe

2010-02-16 Thread Funog
Is it possible to run an external .exe and have access to its standard input/output? Apparently std.process does not allow this.

using DDE with D

2009-12-10 Thread Funog
Can I have some clues on how to use DDE in a D program? Thanks.

something weird about polymorphism

2009-11-15 Thread funog
The following code : -- import std.stdio; class A { void foo(A a) { writefln(A); } } class B : A { void foo(B b) { writefln(B); } } void main() { B b = new B; A a = b; assert(a is b); b.foo(b); a.foo(b); } --

Re: something weird about polymorphism

2009-11-15 Thread funog
downs wrote: funog wrote: The following code : -- import std.stdio; class A { void foo(A a) { writefln(A); } } class B : A { void foo(B b) { writefln(B); } } void main() { B b = new B; A a = b; assert(a is b); b.foo(b

Using ANSI codes

2009-11-03 Thread Funog
How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other...

Re: Using ANSI codes

2009-11-03 Thread funog
Stewart Gordon Wrote: Funog wrote: How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other... At first I thought you meant the ANSI character set, but then I realised you're probably talking about ANSI.SYS

Re: waking up a thread

2009-08-13 Thread funog
Steven Schveighoffer Wrote: On Wed, 12 Aug 2009 13:00:22 -0400, funog fu...@ifrance.com wrote: Is there a way to make the current thread sleep for a given amount of time, while having the possibility of another thread waking it up earlier? Create a mutex/condition pair, then have

waking up a thread

2009-08-12 Thread funog
Is there a way to make the current thread sleep for a given amount of time, while having the possibility of another thread waking it up earlier?