Hacker News new | past | comments | ask | show | jobs | submit login

As people have pointed already elsewhere, the same declaration can be made more clear by isolating the type like so:

    var gpa: std.mem.GeneralPurposeAllocator(.{}) = .{};



Also note that on Zig master, initializing `GeneralPurposeAllocator` like this is deprecated -- it'll be removed after the next release. Instead, you should do this:

  var gpa: std.mem.GeneralPurposeAllocator(.{}) = .init;


Ah yes. Much more clear. Thank you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: