MCPcopy Create free account
hub / github.com/NativeScript/android / size

Function size

test-app/runtime/src/main/cpp/v8_inspector/src/base/vector.h:154–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153template <typename T>
154class OwnedVector {
155 public:
156 MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS(OwnedVector);
157 OwnedVector(std::unique_ptr<T[]> data, size_t length)
158 : data_(std::move(data)), length_(length) {
159 DCHECK_IMPLIES(length_ > 0, data_ != nullptr);
160 }
161
162 // Implicit conversion from {OwnedVector<U>} to {OwnedVector<T>}, instantiable
163 // if {std::unique_ptr<U>} can be converted to {std::unique_ptr<T>}.
164 // Can be used to convert {OwnedVector<T>} to {OwnedVector<const T>}.
165 template <typename U,
166 typename = typename std::enable_if<std::is_convertible<
167 std::unique_ptr<U>, std::unique_ptr<T>>::value>::type>
168 OwnedVector(OwnedVector<U>&& other)
169 : data_(std::move(other.data_)), length_(other.length_) {
170 STATIC_ASSERT(sizeof(U) == sizeof(T));
171 other.length_ = 0;
172 }
173
174 // Returns the length of the vector as a size_t.
175 constexpr size_t size() const { return length_; }
176
177 // Returns whether or not the vector is empty.
178 constexpr bool empty() const { return length_ == 0; }

Callers 7

unmapped_sizeFunction · 0.70
ContainsFunction · 0.70
containsMethod · 0.70
endFunction · 0.70
as_vectorFunction · 0.70
SmallVectorClass · 0.70
pop_backMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected