Lines Matching refs:Vector
22 class Vector {
28 constexpr Vector() : start_(nullptr), length_(0) {}
30 constexpr Vector(T* data, size_t length) : start_(data), length_(length) {
34 static Vector<T> New(size_t length) {
35 return Vector<T>(new T[length], length);
40 Vector<T> SubVector(size_t from, size_t to) const {
43 return Vector<T>(begin() + from, to - from);
84 Vector<T> Clone() const {
87 return Vector<T>(result, length_);
103 Vector<T> operator+(size_t offset) {
105 return Vector<T>(start_ + offset, length_ - offset);
108 Vector<T> operator+=(size_t offset) {
115 // Implicit conversion from Vector<T> to Vector<const T>.
116 operator Vector<const T>() const { return {start_, length_}; }
119 static Vector<T> cast(Vector<S> input) {
126 return Vector<T>(reinterpret_cast<T*>(input.begin()),
130 bool operator==(const Vector<const T> other) const {
134 bool operator!=(const Vector<const T> other) const {
144 class V8_NODISCARD ScopedVector : public Vector<T> {
146 explicit ScopedVector(size_t length) : Vector<T>(new T[length], length) {}
195 // Returns a {Vector<T>} view of the data in this vector.
196 Vector<T> as_vector() const { return Vector<T>(start(), size()); }
253 constexpr Vector<const char> StaticCharVector(const char (&array)[N]) {
258 inline Vector<const char> CStrVector(const char* data) {
264 inline Vector<const uint8_t> OneByteVector(const char* data, size_t length) {
268 inline Vector<const uint8_t> OneByteVector(const char* data) {
273 Vector<const uint8_t> StaticOneByteVector(const char (&array)[N]) {
281 inline constexpr Vector<T> ArrayVector(T (&arr)[N]) {
285 // Construct a Vector from a start pointer and a size.
287 inline constexpr Vector<T> VectorOf(T* start, size_t size) {
291 // Construct a Vector from anything providing a {data()} and {size()} accessor.
298 // Construct a Vector from an initializer list. The vector can obviously only be
302 inline constexpr Vector<const T> VectorOf(std::initializer_list<T> list) {
307 class EmbeddedVector : public Vector<T> {
309 EmbeddedVector() : Vector<T>(buffer_, kSize) {}
310 explicit EmbeddedVector(const T& initial_value) : Vector<T>(buffer_, kSize) {