-
Notifications
You must be signed in to change notification settings - Fork 10
Update gsl-lite dependency to v1.0 #264
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
Conversation
The least invasive fix would be to re-enable span comparison operators by defining `gsl_CONFIG_ALLOWS_SPAN_COMPARISON=1`. However, comparison operators are no longer provided by default for good reason (unclear semantics), and C++20 `std::span<>` doesn't have comparison operators either, so this appears to be the most forward-looking way to handle it.
The gsl-lite build script is well-behaved an d does not build tests by default.
|
The Appveyor tests fail because they retrieve their dependencies with Vcpkg, which doesn't have gsl-lite v1.0 yet. I submitted a PR to upgrade gsl-lite to v1.0.0, only to find that this breaks Telnet++. A Catch-22 situation :) |
|
@mbeutel This is great, thanks for the contrib. I'm actually in the (slow) process of removing gsl-lite from my libraries because C++20 obsoletes the parts that I use, but this is very fine for the situation that it's in and if it fixes integration with vcpkg, then all for the better. Much appreciated. |
|
Excellent, thank you for the quick response! The GSL was already a stop-gap when the Core Guidelines were introduced 10 years ago; it really shouldn't need to exist anymore. C++20 added spans (albeit unchecked ones), and C++26 will finally add contracts, so more and more of the GSL will become obsolete. I think gsl-lite can be considered "done" at this point; I just wanted to finally resolve the interference issue with Microsoft GSL, which in turn required the breaking change. |
|
In any case, your contributions have been a great help, so thank you. |
|
Thanks for preparing the new release so quickly. Telnet++ 4.0.0 is now available via Vcpkg. |
|
Awesome! |
This PR bumps the gsl-lite dependency version to v1.0.
gsl-lite v1.0 has some breaking changes (cf. our v1.0.0 release notes), which necessitate some changes here.
The most obvious changes are the name of the header file (now
<gsl-lite/gsl-lite.hpp>) and the namespace (nowgsl_lite; I added agslalias to namespacetelnetpp).By default,
span<>does not define comparison operators anymore, which means that we need to compare spans through other means. I added abytes_equal()function object to explicitly compare two byte spans and adapted the code where necessary. A less invasive fix would be to re-enable span comparison operators by defininggsl_CONFIG_ALLOWS_SPAN_COMPARISON=1. However, comparison operators are no longer provided by default for good reason (unclear semantics), and C++20std::span<>doesn't have them either, so this appears to be the most forward-looking way to handle it.Some minor adjustments were needed because
span<>::iteratoris now a custom iterator class rather than a plain pointer type.This change is