Add checks for extent compatability in span range constructor #181
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.
Based on discussion in #179 / @pdimov suggestion.
few notes
span
of extent 3 fromboost::array
of size 4. As this is not allowed forstd::array
I presumed same logic should follow for other ranges.span_default_constructed_size
works correctly maybe it should be moved to separate header if we think it will be useful in more placesBOOST_ASSERT
, I prefer to do that in separate PRmax_size
, that may be useful for some fixed buffer types, e.g. static_stringstd::span
availability in test I used C++23 macro(I presume all C++23 compilers have all C++20 headers) since it is easier than to check for span header, if you prefer I can switch to specific span checkboost::array
as a nice range type, I know core can not depend on almost anything, but I presumed it is fine in tests a I think boost array does not depend on core, if not let me know so I make a simple test type.b2 cxxstd=03 test
fails, not sure if that is fine as C++11 is new minimal Boost version