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
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)
/
Thanks, that works. I'll report the bug as well.
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
extern(C) {
struct ab;
}
ab*[int] map;
void main() {
map.clear();
}
Cannot be compiled. Why?
Thanks.
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