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

Remove GSL in favor of stdlib #593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove GSL in favor of stdlib #593

wants to merge 1 commit into from

Conversation

elshize
Copy link
Member

@elshize elshize commented Dec 11, 2024

We mostly used GSL for its span class. After moving to the C++20 standard, we now have std::span available to us. It is more explicit in how it works because it's driven by the standard, and it allows us not to rely on a third party library.

std::span does no bound checks, so indexed access had to be guarded with explicit checks when necessary. Some helper functions were introduced, including equality operator.

Expect macros were replaced with if statements that throw std::invalid_argument if the contract is not upheld.

Changelog-changed: GSL is removed as dependency
Changelog-changed: gsl::span is replaced with std::span

We mostly used GSL for its `span` class. After moving to the C++20
standard, we now have `std::span` available to us. It is more explicit
in how it works because it's driven by the standard, and it allows us
not to rely on a third party library.

`std::span` does no bound checks, so indexed access had to be guarded
with explicit checks when necessary. Some helper functions were
introduced, including equality operator.

`Expect` macros were replaced with `if` statements that throw
`std::invalid_argument` if the contract is not upheld.

Changelog-changed: GSL is removed as dependency
Changelog-changed: gsl::span is replaced with std::span
Signed-off-by: Michal Siedlaczek <[email protected]>
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.80%. Comparing base (d645b4e) to head (b33c8f8).

Files with missing lines Patch % Lines
include/pisa/span.hpp 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #593      +/-   ##
==========================================
- Coverage   93.84%   93.80%   -0.04%     
==========================================
  Files          80       81       +1     
  Lines        3884     3893       +9     
==========================================
+ Hits         3645     3652       +7     
- Misses        239      241       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@JMMackenzie JMMackenzie left a comment

Choose a reason for hiding this comment

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

Nice, this is great!

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