Re: Using allSatisfy with template that takes multiple type arguments

2011-09-28 Thread Christophe
Andrej Mitrovic , dans le message (digitalmars.D.learn:29825), a écrit : > Thanks for the tips guys. I have another similar issue now, I want to > check whether a type passes any of the predicates I list. This would > be similar to anySatisfy, however anySatisfy takes one predicate and > multiple t

Re: Using allSatisfy with template that takes multiple type arguments

2011-09-28 Thread bearophile
Andrej Mitrovic: > But the compiler thinks I'm doing C-style casts so this doesn't work. Any > clues? This seems to work (eye the base of the recursion): template satisfies(T, alias P) { enum satisfies = P!T; } template anyPredicateSatisfy(T, Preds...) { static if (Preds.length) /

Re: Using allSatisfy with template that takes multiple type arguments

2011-09-28 Thread Andrej Mitrovic
Thanks, that works. I'll report the bug as well.

Re: Multithreaded file IO?

2011-09-28 Thread Jerry
trav...@phare.normalesup.org (Christophe) writes: > Jerry Quinn , dans le message (digitalmars.D.learn:29763), a écrit : >> What I really want is a shared fifo where the input is lines from a >> file, and many workers grab something from the fifo. They then push >> their results into a shared r

Why an abstract pointer cannot be used as value in an associate array?

2011-09-28 Thread Cheng Wei
extern(C) { struct ab; } ab*[int] map; void main() { map.clear(); } Cannot be compiled. Why? Thanks.

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-28 Thread bearophile
Cheng Wei: > extern(C) { > struct ab; > } > > ab*[int] map; > > void main() { > map.clear(); > } > > > Cannot be compiled. Why? It's not specific of associative arrays: extern(C) { struct AB; } AB*[] arr; void main() { arr.length += 1; } Bye, bearophile