Fixed last commit compiler error

master
Jimmi HC 2018-07-04 11:35:29 +02:00
parent 4f32b86142
commit 28821b5f31
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ pub const Allocator = struct {
/// Call `destroy` with the result /// Call `destroy` with the result
pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) { pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) {
const T = @typeOf(init); const T = @typeOf(init);
if (@sizeOf(T) == 0) return &T{}; if (@sizeOf(T) == 0) return &(T{});
const slice = try self.alloc(T, 1); const slice = try self.alloc(T, 1);
const ptr = &slice[0]; const ptr = &slice[0];
ptr.* = init; ptr.* = init;