Home | History | Annotate | Download | only in openssl

Lines Matching refs:Span

32 class Span;
38 // they can be used with any type that implicitly converts into a Span.
40 "Span<T> must be derived from SpanBase<const T>");
42 friend bool operator==(Span<T> lhs, Span<T> rhs) {
59 friend bool operator!=(Span<T> lhs, Span<T> rhs) { return !(lhs == rhs); }
63 // A Span<T> is a non-owning reference to a contiguous array of objects of type
64 // |T|. Conceptually, a Span is a simple a pointer to |T| and a count of
65 // elements accessible via that pointer. The elements referenced by the Span can
68 // A Span can be constructed from container types implementing |data()| and
74 // void Foo(bssl::Span<const uint8_t> v) { ... }
82 // void FooMutate(bssl::Span<uint8_t> v) { ... }
84 // FooMutate(bssl::Span<uint8_t>(vec));
87 // construct Spans in order to deduce the type of the Span automatically.
95 class Span : private internal::SpanBase<const T> {
98 // a Span by checking for data() and size() member functions.
112 constexpr Span() : Span(nullptr, 0) {}
113 constexpr Span(T *ptr, size_t len) : data_(ptr), size_(len) {}
116 constexpr Span(T (&array)[N]) : Span(array, N) {}
121 Span(const C &container) : data_(container.data()), size_(container.size()) {}
126 explicit Span(C &container)
150 Span subspan(size_t pos = 0, size_t len = npos) const {
152 abort(); // absl::Span throws an exception here.
154 return Span(data_ + pos, std::min(size_ - pos, len));
163 const size_t Span<T>::npos;
166 Span<T> MakeSpan(T *ptr, size_t size) {
167 return Span<T>(ptr, size);
176 Span<const T> MakeConstSpan(T *ptr, size_t size) {
177 return Span<const T>(ptr, size);