‹ BackHN Continuity

Thread

Comparing reflection capabilities of C++, Zig and C3

11 points · 7 comments · ManuLinares

  1. RyanVail · · focus · HN ↗
    Zig doesn't have attributes, but you could just create a thin wrapper struct over an inner type and use setter functions that throw errors on invalid values. Personally I prefer this over attributes because it forces you to handle possible error states from the callers of the setters, instead of relying on you remembering to call `validate` on your types.
    1. lerno · · focus · HN ↗
      I believe all examples are derived from C++ examples on its new reflection capabilities.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.