mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-25 01:01:58 -05:00
da01eb28db
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. |
||
---|---|---|
.. | ||
algorithm | ||
assert | ||
byte | ||
gsl | ||
gsl_algorithm | ||
gsl_assert | ||
gsl_byte | ||
gsl_narrow | ||
gsl_util | ||
narrow | ||
pointers | ||
span | ||
span_ext | ||
string_span | ||
util |