Skip to content

<memory>: uninitialized_meow should handle voidify's wording #1780

Description

WG21-N4885 [specialized.algorithms.general]/4 says that the uninitialized_meow family of algorithms is powered by an exposition-only voidify helper, which has the interesting property of returning modifiable void*. Surprisingly, this intentionally handles destinations that are iterator-to-const, allowing const elements to be constructed in uninitialized memory.

We should add test coverage for this scenario, for all of the uninitialized_meow algorithms that are affected. This may require reworking internal machinery like _Ptr_copy_cat/_Ptr_move_cat. Finally, we should ensure that we don't disrupt the plain meow algorithms, which should not be allowed to modify through iterator-to-const (as they aren't specified with voidify).

Noticed while reviewing #1772, but filed as a separate issue as this is pre-existing, non-trivial, and largely unrelated to that PR's scope.

Activity

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

    invalidThis issue is incorrect or by design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions