mirror of
https://github.com/microsoft/GSL.git
synced 2025-05-12 17:05:20 -04:00
simplified constructors and removed GSL_NOEXCEPT in span (#639)
- simplified storage constructors to reduce branching - eliminated null check for constructor from array - removed GSL_NOEXCEPT in span
This commit is contained in:
@ -417,9 +417,8 @@ public:
|
||||
constexpr string_span_type as_string_span() const GSL_NOEXCEPT
|
||||
{
|
||||
auto sz = span_.size();
|
||||
return span_.first(sz <= 0 ? 0 : sz - 1);
|
||||
return { span_.data(), sz > 1 ? sz - 1 : 0 };
|
||||
}
|
||||
|
||||
constexpr string_span_type ensure_z() const GSL_NOEXCEPT { return gsl::ensure_z(span_); }
|
||||
|
||||
constexpr const_zstring_type assume_z() const GSL_NOEXCEPT { return span_.data(); }
|
||||
|
Reference in New Issue
Block a user