GDC and DMD incompatability, can both be used?

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Jul 11 04:51:54 UTC 2020


On Sat, Jul 11, 2020 at 04:28:32AM +0000, cy via Digitalmars-d-learn wrote:
> hunt/source/hunt/serialization/JsonSerializer.d:125:20: error: basic
> type expected, not foreach
>   125 |             static foreach (string member; FieldNameTuple!T) {
> 
> I'm having a little trouble using the hunt library with gdc. Does gdc
> not support static foreach at all? Is there some way to write code
> that it can understand, which does the same thing?

Which version of GDC are you using?  Static foreach is a relatively new
feature, and GDC may not have picked it up yet.

GDC uses exactly the same front end as DMD (and LDC), so there is no
fundamental incompatibility. The only issue is that GDC is tied to the
GCC release cycle, so it may be a few releases behind DMD, and therefore
lack some newer features.  Eventually it will catch up, though.


T

-- 
When solving a problem, take care that you do not become part of the problem.


More information about the Digitalmars-d-learn mailing list