Function add [src]

r = a + b r, a and b may be aliases. Returns an error if memory could not be allocated.

Prototype

pub fn add(r: *Managed, a: *const Managed, b: *const Managed) Allocator.Error!void

Parameters

r: *Manageda: *const Managedb: *const Managed

Source

pub fn add(r: *Managed, a: *const Managed, b: *const Managed) Allocator.Error!void { try r.ensureAddCapacity(a.toConst(), b.toConst()); var m = r.toMutable(); m.add(a.toConst(), b.toConst()); r.setMetadata(m.positive, m.len); }