Skip to content

vec needs clear #2814

Closed
Closed

Description

@catamorphism

Similarly to #2775 -- FIXME in typeck::transaction_methods::commit says "could use a vec::clear() that ran destructors but kept the vec at its currently allocated length"

Activity

  1. kud1ing commented on Jul 6, 2012

    @kud1ing

    I think clear would be counterintuitive to the use in other languages (returning an empty vector/list/array). Maybe blank instead?

  2. jld commented on Sep 8, 2012

    @jld
    Contributor

    If I understand the issue correctly, vec::clear(v) can be expressed as vec::truncate(v, 0) as of ec9c68c.

  3. catamorphism commented on Nov 24, 2012

    @catamorphism
    ContributorAuthor

    Closing since it's easy enough to use truncate.

  4. added a commit that references this issue on Apr 11, 2023
  5. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions