Mercurial > projects > qtd
comparison d2/qtd/Signal.d @ 396:d0a103f25091
Work around CTFE regression in DMD.
The error message emitted by DMD 2.051 was ?Declaration (string, ?, string) allSymbols = tuple("__ctor", ?, "__T8Q_OBJECTZ") is not yet implemented in CTFE?.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Mon, 03 Jan 2011 08:06:13 +0100 |
parents | a032df77b6ab |
children | 8564ab82ea42 |
comparison
equal
deleted
inserted
replaced
395:d757b8b1ca75 | 396:d0a103f25091 |
---|---|
206 // ------------------------------------------------------------------ | 206 // ------------------------------------------------------------------ |
207 | 207 |
208 string[] getSymbols(C)(string prefix) | 208 string[] getSymbols(C)(string prefix) |
209 { | 209 { |
210 string[] result; | 210 string[] result; |
211 auto allSymbols = __traits(derivedMembers, C); | 211 foreach(s; __traits(derivedMembers, C)) |
212 foreach(s; allSymbols) | |
213 { | 212 { |
214 if(startsWith(s, prefix)) | 213 if(startsWith(s, prefix)) |
215 result ~= s; | 214 result ~= s; |
216 } | 215 } |
217 return result; | 216 return result; |