-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
In subspan function, add static checks on extents #843
In subspan function, add static checks on extents #843
Conversation
Review changes with SemanticDiff. |
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.
static_assert
should be replaced with ETL_STATIC_ASSERT
.
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.
The static asserts have no message fields
I also realized that the first and last functions also behave similarly, so I have also added the checks for those functions. I believe those are all the functions where static checks are possible.
I don't know if it makes sense to also add the static assert for the pre c++11 subspan function? I'll await @jwellbelove feedback. |
The |
Thanks. I duplicated the static asserts for the pre c++11 subspan function. I should be finished with changes unless there are other issues. |
4b12e98
into
ETLCPP:pull-request/#843-In-subspan-function,-add-static-checks-on-extents
…s-on-extents' into development
Potential fix for issue #842
etl::span subspan function does not currently statically check extents. std::span does check this.
Code demonstration:
This PR should enable c++11 and newer to have compile error when the extent check fails.