File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,16 @@ struct span {
141141 value_type *data_ {};
142142 size_type size_ {};
143143
144+ constexpr span () noexcept = default;
145+ constexpr span (value_type *data, size_type size) noexcept : data_(data), size_(size) {}
146+ constexpr span (value_type *data, value_type *end) noexcept : data_(data), size_(end - data) {}
147+
144148 constexpr value_type *begin () const noexcept { return data_; }
145149 constexpr value_type *end () const noexcept { return data_ + size_; }
146150 constexpr value_type *data () const noexcept { return data_; }
147151 constexpr size_type size () const noexcept { return size_; }
148152 constexpr size_type length () const noexcept { return size_; }
153+ constexpr size_type size_bytes () const noexcept { return size_ * sizeof (value_type); }
149154 constexpr value_type &operator [](size_type i) const noexcept { return data_[i]; }
150155};
151156
You can’t perform that action at this time.
0 commit comments