mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
9face82309
`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 |
||
---|---|---|
.. | ||
algorithm_tests.cpp | ||
assertion_tests.cpp | ||
at_tests.cpp | ||
byte_tests.cpp | ||
CMakeLists.txt | ||
CMakeLists.txt.in | ||
deathTestCommon.h | ||
no_exception_ensure_tests.cpp | ||
notnull_tests.cpp | ||
owner_tests.cpp | ||
span_compatibility_tests.cpp | ||
span_ext_tests.cpp | ||
span_tests.cpp | ||
strict_notnull_tests.cpp | ||
utils_tests.cpp |