Home | History | Annotate | Download | only in openssl

Lines Matching refs:Span

31 class Span;
37 // they can be used with any type that implicitly converts into a Span.
39 "Span<T> must be derived from SpanBase<const T>");
41 friend bool operator==(Span<T> lhs, Span<T> rhs) {
58 friend bool operator!=(Span<T> lhs, Span<T> rhs) { return !(lhs == rhs); }
62 // A Span<T> is a non-owning reference to a contiguous array of objects of type
63 // |T|. Conceptually, a Span is a simple a pointer to |T| and a count of
64 // elements accessible via that pointer. The elements referenced by the Span can
67 // A Span can be constructed from container types implementing |data()| and
73 // void Foo(bssl::Span<const uint8_t> v) { ... }
81 // void FooMutate(bssl::Span<uint8_t> v) { ... }
83 // FooMutate(bssl::Span<uint8_t>(vec));
86 // construct Spans in order to deduce the type of the Span automatically.
94 class Span : private internal::SpanBase<const T> {
97 // a Span by checking for data() and size() member functions.
111 constexpr Span() : Span(nullptr, 0) {}
112 constexpr Span(T *ptr, size_t len) : data_(ptr), size_(len) {}
115 constexpr Span(T (&array)[N]) : Span(array, N) {}
120 Span(const C &container) : data_(container.data()), size_(container.size()) {}
125 explicit Span(C &container)
158 Span subspan(size_t pos = 0, size_t len = npos) const {
160 abort(); // absl::Span throws an exception here.
162 return Span(data_ + pos, std::min(size_ - pos, len));
171 const size_t Span<T>::npos;
174 Span<T> MakeSpan(T *ptr, size_t size) {
175 return Span<T>(ptr, size);
184 Span<const T> MakeConstSpan(T *ptr, size_t size) {
185 return Span<const T>(ptr, size);