GSL/include/gsl
dmitrykobets-msft da01eb28db
Remove useless runtime checks in span implementation (#1029)
Both checks for Expects(ExtentType::size() != dynamic_extent); in storage_type are always useless. storage_type<ExtentType> is only ever created with ExtentType == extent_type<Extent>, where Extent has type std::size_t and is the extent of the span.

Looking at extent_type<std::size_t Ext>::size():

- if Ext != dynamic_extent, then size() always returns Ext, and therefore size() != dynamic_extent
- if Ext == dynamic_extent, then size() returns extent_type<dynamic_extent>::size_. size_ can only be set via one of two constructors:
  - constexpr explicit extent_type(size_type size), which already does the check in question
  - constexpr explicit extent_type(extent_type<Other> ext) : size_(ext.size()), which simply relies on the other extent's size() method
So there is no way for ExtentType::size() == dynamic_extent.
2022-04-28 14:58:25 -07:00
..
algorithm quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
assert gsl::at behavior change regarding gsl::span (#985) 2021-05-20 18:18:08 -07:00
byte renaming main logic files. Added warning message of the removal and include passthrough. Renamed includes in the source files. Ran Clang-Format (#946) 2020-10-29 17:38:48 -07:00
gsl quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_algorithm quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_assert quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_byte quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_narrow quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_util quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
narrow Suppress es.46 warning in implementation of gsl::narrow (#1046) 2022-04-28 09:49:38 -07:00
pointers quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
span Remove useless runtime checks in span implementation (#1029) 2022-04-28 14:58:25 -07:00
span_ext quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
string_span quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
util quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00