Differences From Artifact [0665970b47ba63ed]:
- File
src/util.d
- 2012-07-15 01:58:08 - part of checkin [9d983af88c] on branch trunk - Hige parsing and rendering. (user: kinaba) [annotate]
To Artifact [3ea557146e66a2fa]:
- File
src/util.d
- 2012-07-15 06:03:56 - part of checkin [86489420ef] on branch trunk - Avoid ICE. (user: kinaba) [annotate]
2 2 public import std.array;
3 3 public import std.conv;
4 4 public import std.range;
5 5 public import std.stdio;
6 6 public import std.string;
7 7 public import std.typecons;
8 8 import std.c.stdlib;
9 +
10 +// To avoide the following ICE:
11 +// src\phobos\std\algorithm.d(4552):
12 +// Error: function std.algorithm.count!("a == b",string,char).count
13 +// compiler error, parameter 'value', bugzilla 2962?
14 +// Assertion failure: '0' on line 717 in file 'glue.c'
15 +int count(T,V)(T[] a, V v)
16 +{
17 + int cnt = 0;
18 + foreach(e; a)
19 + if(e == v)
20 + ++cnt;
21 + return cnt;
22 +}
9 23
10 24 void application_exit()
11 25 {
12 26 std.c.stdlib.exit(0);
13 27 }
14 28
15 29 template DeriveCreate()