Function addScalar [src]

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

Prototype

pub fn addScalar(r: *Managed, a: *const Managed, scalar: anytype) Allocator.Error!void

Parameters

r: *Manageda: *const Managed

Source

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