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:
1 parent
c9e423d7cf
commit
c6bf25a5f6
2 files changed
+60
-50
No files matched your search
@@ -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