Skip to content
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

deprecate features adopted into C++ #1198

Merged

Conversation

carsonRadtke
Copy link
Collaborator

@carsonRadtke carsonRadtke commented Feb 14, 2025

  1. Mark the following GSL features as deprecated:
  • gsl::unique_ptr (always)
  • gsl::shared_ptr (always)
  • gsl::byte (since c++17)
  • gsl::joining_thread (never implemented)
  1. Refactor existing deprecations to use the new GSL_DEPRECATED(msg) macro.
  2. Create a section in the README for deprecated features in the
    standard.

1) Mark the following GSL features as deprecated:
 - gsl::unique_ptr (always)
 - gsl::shared_ptr (always)
 - gsl::byte (since c++17)
 - gsl::joining_thread (never implemented)
2) Refactor existing deprecations to use the new GSL_DEPRECATED(msg) macro.
3) Create a section in the README for deprecated features in the
   standard.
@carsonRadtke carsonRadtke force-pushed the deprecated-standardized-features branch 3 times, most recently from ac626c0 to 49e86be Compare February 14, 2025 04:05
@carsonRadtke carsonRadtke force-pushed the deprecated-standardized-features branch from 49e86be to 7b3165e Compare February 14, 2025 04:08
@carsonRadtke carsonRadtke added Type: Enhancement Suggests an improvement or new feature Status: Review Needed Needs review from GSL maintainers labels Feb 14, 2025
@carsonRadtke carsonRadtke changed the title deprecated features adopted into C++ deprecate features adopted into C++ Feb 14, 2025
@carsonRadtke carsonRadtke merged commit 7fabaa4 into microsoft:main Feb 14, 2025
83 checks passed
@carsonRadtke carsonRadtke deleted the deprecated-standardized-features branch February 14, 2025 17:24
Comment on lines +77 to +82
#if GSL_USE_STD_BYTE
#define BYTE_TYPE std::byte
#else // !GSL_USE_STD_BYTE
#define BYTE_TYPE byte
#endif // GSL_USE_STD_BYTE

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that macro introduced? It was not needed before. Did some code not compile without this macro?

And why is this macro exported?

A macro with a generic name like BYTE_TYPE looks like it has potential to break existing code.

@@ -18,7 +18,7 @@
#define GSL_SPAN_H

#include "./assert" // for Expects
#include "./byte" // for byte
#include "./byte" // for BYTE_TYPE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worries me if that change is necessary. That would mean that users using GSL might also need to use BYTE_TYPE instead of gsl::byte, which in my opinion is a change for the worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Needs review from GSL maintainers Type: Enhancement Suggests an improvement or new feature
Projects
Development

Successfully merging this pull request may close these issues.

2 participants