Containers
deadalnix
deadalnix at gmail.com
Wed Sep 1 11:38:02 UTC 2021
On Wednesday, 1 September 2021 at 10:44:46 UTC, Per Nordlöw wrote:
> On Tuesday, 31 August 2021 at 17:21:02 UTC, deadalnix wrote:
>> I want to start working on a container library. Interestingly
>> enough, I don't think we have what we need on that front.
>
> Moreover, Rust collections provides makes rich of static
> members such as [1]
>
> `C.with_capacity(size_t)`
>
> instead of guessing what C(42) means which have introduced bugs
> in my code previously.
>
> Might be worthwhile considering making use of these patterns.
>
> My containers make use of such static members.
>
> [1]
> https://doc.rust-lang.org/std/vec/struct.Vec.html#method.with_capacity.
I have adopted that style a lot lately and this is indeed much
better than C(42).
More information about the Digitalmars-d
mailing list