mirror of
https://github.com/microsoft/GSL.git
synced 2025-11-17 07:49:36 +01:00
gsl::at behavior change regarding gsl::span (#985)
* 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>
This commit is contained in:
committed by
GitHub
parent
c1cbb41b42
commit
b26f6d5ec7
@@ -16,14 +16,14 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <gsl/util> // finally, narrow_cast
|
||||
#include <gsl/narrow> // for narrow, narrowing_error
|
||||
#include <algorithm> // for move
|
||||
#include <cstddef> // for std::ptrdiff_t
|
||||
#include <functional> // for reference_wrapper, _Bind_helper<>::type
|
||||
#include <gsl/narrow> // for narrow, narrowing_error
|
||||
#include <gsl/util> // finally, narrow_cast
|
||||
#include <limits> // for numeric_limits
|
||||
#include <stdint.h> // for uint32_t, int32_t
|
||||
#include <type_traits> // for is_same
|
||||
#include <cstddef> // for std::ptrdiff_t
|
||||
|
||||
using namespace gsl;
|
||||
|
||||
@@ -32,8 +32,7 @@ namespace
|
||||
void f(int& i) { i += 1; }
|
||||
static int j = 0;
|
||||
void g() { j += 1; }
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST(utils_tests, sanity_check_for_gsl_index_typedef)
|
||||
{
|
||||
@@ -123,6 +122,7 @@ TEST(utils_tests, narrow_cast)
|
||||
EXPECT_TRUE(uc == 44);
|
||||
}
|
||||
|
||||
#ifndef GSL_KERNEL_MODE
|
||||
TEST(utils_tests, narrow)
|
||||
{
|
||||
int n = 120;
|
||||
@@ -145,3 +145,4 @@ TEST(utils_tests, narrow)
|
||||
n = -42;
|
||||
EXPECT_THROW(narrow<unsigned>(n), narrowing_error);
|
||||
}
|
||||
#endif // GSL_KERNEL_MODE
|
||||
|
||||
Reference in New Issue
Block a user