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
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
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)
Is it possible to run an external .exe and have access to its standard
input/output? Apparently std.process does not allow this.
Can I have some clues on how to use DDE in a D program?
Thanks.
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);
}
--
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
How can I get a D1 console program to use ANSI codes? Currently it just prints
the escape character like any other...
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
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
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?
11 matches
Mail list logo