Skip to content

✨ Add reason to = delete where available #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Aug 1, 2025

Problem:

  • C++26 adds = delete("should have a reason") with https://wg21.link/P2573. This is implemented by clang-19 onwards, and also backported by clang to earlier language versions, so we can take advantage of it compiling with -std=c++20.

Solution:

  • Add STDX_DELETED macro to provide a reason where possible.

Note:

  • This is also implemented by GCC 15 and later, but GCC does not backport the feature to language versions before C++26.

@elbeno elbeno force-pushed the delete-has-a-reason branch from 1c4b584 to 93d5415 Compare August 4, 2025 02:29
Problem:
- C++26 adds `= delete("should have a reason")` with https://wg21.link/P2573.
  This is implemented by clang-19 onwards, and also backported by clang to
  earlier language versions, so we can take advantage of it compiling with
  `-std=c++20`.

Solution:
- Add `STDX_DELETED` macro to provide a reason where possible.

Note:
- This is also implemented by GCC 15 and later, but GCC does not backport the
  feature to language versions before C++26.
@lukevalenty lukevalenty enabled auto-merge August 4, 2025 15:58
@lukevalenty lukevalenty merged commit 66cbe3e into intel:main Aug 4, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants