-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Replace gsl::byte/span with std #14763
Conversation
static constexpr VTParameter defaultParameter; | ||
static constexpr std::span defaultParameters{ &defaultParameter, 1 }; | ||
|
||
std::span<const VTParameter> _values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a more significant change, as the []
operator of std::span
is not considered safe anymore (unlike gsl::span
it doesn't fail-fast). When fixing it with til::at
I noticed that for_each
can be simplified with a for-range loop.
return cont[i]; | ||
} | ||
#pragma warning(suppress : 26445) // Suppress lifetime check for a reference to std::span or std::string_view | ||
return cont[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike gsl::span
, std::span
has an unchecked []
operator, so the extra if constexpr
isn't necessary anymore.
BTW this made me realize that til::at
might be a bit poorly named... I think we should rename it as til::at_unchecked
or something, so that we can add a til::at_failfast
and similar (and to make the intent clearer to future maintainers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed in an unusual way, but I got all 97.
For future reviewers: Leonard is not lying when he says it's all mechanical. If you review only one file, make it DispatchTypes.cpp |
This is a rather trivial changeset. Now that these two are present in the
std
namespace there's no reason for us to continue using thegsl
ones.Additionally this ensures future compatibility with other 3rd party libraries.