withCapacityMake

Return an instance of R with capacity capacity.

  1. R withCapacityMake(size_t capacity)
    R
    withCapacityMake
    (
    R
    )
    (
    size_t capacity
    )
    if (
    __traits(hasMember, R, "withCapacity")
    )
  2. R withCapacityMake(size_t capacity)

Examples

immutable capacity = 10;
auto x = capacity.withCapacityMake!(int[]);
assert(x.capacity >= capacity);

Meta