* Add more gsl::span tests [copilot]
This PR adds comprehensive unit tests for `gsl::span` to ensure its correctness and consistency. The following tests have been added:
1. **Empty Span Tests**:
- Tests to verify the behavior of an empty `gsl::span` and `gsl::span<const int>`.
2. **Conversion Tests**:
- Tests to check the conversion between different types of `gsl::span`.
3. **Comparison Operator Tests**:
- Tests to verify the comparison operators for `gsl::span`.
4. **Deduction Guide Tests**:
- Tests to compare the behavior of `gsl::span` and `std::span` deduction guides for various types of arrays and containers.
These tests help ensure that `gsl::span` behaves correctly in various scenarios and is consistent with `std::span`.
This PR was created with the help of GitHub Copilot.
**Changes**:
- Added tests for empty span.
- Added tests for conversions.
- Added tests for comparison operators.
- Added tests for deduction guides.
**Testing**:
- All new tests have been added to the existing test suite.
- Run the test suite using `ctest` to ensure all tests pass.This PR adds comprehensive unit tests for `gsl::span` to ensure its correctness and consistency. The following tests have been added:
1. **Empty Span Tests**:
- Tests to verify the behavior of an empty `gsl::span` and `gsl::span<const int>`.
2. **Conversion Tests**:
- Tests to check the conversion between different types of `gsl::span`.
3. **Comparison Operator Tests**:
- Tests to verify the comparison operators for `gsl::span`.
4. **Deduction Guide Tests**:
- Tests to compare the behavior of `gsl::span` and `std::span` deduction guides for various types of arrays and containers.
These tests help ensure that `gsl::span` behaves correctly in various scenarios and is consistent with `std::span`.
This PR was created with the help of GitHub Copilot.
**Changes**:
- Added tests for empty span.
- Added tests for conversions.
- Added tests for comparison operators.
- Added tests for deduction guides.
**Testing**:
- All new tests have been added to the existing test suite.
- Run the test suite using `ctest` to ensure all tests pass.
* fix tests for pre-C++17
`size_bytes()` returns the span's size in bytes.
Assuming the span was constructed with an accurate size parameter, the check `size() < dynamic_extent / sizeof(element_type)` isn't required, since `size_t(-1)` (which is `dynamic_extent`) represents the size of the address space, so the number of bytes will never exceed it and in practice won't even come close.
Otherwise, it is not actually feasible to detect cases when the size parameter does not correspond to the dimensions of the underlying data pointer. In these cases, the relationship `size() < dynamic_extent / sizeof(element_type)` is simply one of many ways in which the `size()` could be incorrect, and serves no necessary purpose.
Resolves#1012
* move span specialization of 'at' to <gsl/span> and update the parameter to be taken by reference
* undid previous changes and acted upon decisions made in maintainer sync. Fixed tests failing in /kernel mode
* ran clang-format on the include folder
* ran clang-format on the test folder
Co-authored-by: Jordan Maples <jordan.maples@microsoft.com>