[O2-2018] Changes to allow usage of either v2 or v3 of Microsoft GSL. #5424
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 3.0.0 of Microsoft's implementation of the C++ Core Guidelines
Support Library (GSL) (https://github.com/microsoft/GSL/releases/tag/v3.0.0)
introduces a few breaking changes that affect our code.
At the same time it's more future proof than v2 by being closer to
the C++20 version of span, and has the very immediate
benefit of compiling fine on Apple Silicon (while v2 does not).
So, in order to prepare for the migration to v3, we introduce a compile
definition and use to switch between syntaxes in the few places where the
breaking changes impact us.
Next step will be to update the alidist recipe to build v3(v3.1 really)
instead of v2(.1).
As a side note, v3(.1) also adds proper CMake config file that should
eventually replace our custom Findms_gsl.cmake module (once we switch
to v3 only).