Skip to content

Default for AtomicPtr? #24613

Closed
Closed

Description

Is there any reason why there isn't an ATOMIC_PTR_INIT (cf ATOMIC_BOOL_INIT, ATOMIC_ISIZE_INIT, &c.) struct? I'd like to use AtomicPtrs in statically-initialized variables - and AtomicPtr is the only atomic class that doesn't implement the Default trait. A std::ptr::null_mut() seems to be a sensible initial value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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