summaryrefslogtreecommitdiff
path: root/include/ftl
diff options
context:
space:
mode:
author Ryan Prichard <rprichard@google.com> 2024-08-26 20:12:57 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-08-26 20:12:57 +0000
commitb035cb70c9fd1a5729acabab1f3247e0b75889a4 (patch)
treefee62e38d2c5535fe5cbbb4991780c635b251409 /include/ftl
parent4444fc1e0b37fac76090cbd865125eb4af8238b7 (diff)
parent795c8b31dfc1dfd285cba7b50a58a452b1682122 (diff)
Merge "ftl: delegate SmallVector<const T> to std::vector<T>" into main am: 795c8b31df
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3235958 Change-Id: Ie451e6134a07d6f61ff25ad6a9b9fc8c5aab61de Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'include/ftl')
-rw-r--r--include/ftl/small_vector.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/ftl/small_vector.h b/include/ftl/small_vector.h
index 43e9fac5e2..3d5d52e80c 100644
--- a/include/ftl/small_vector.h
+++ b/include/ftl/small_vector.h
@@ -234,7 +234,7 @@ class SmallVector final : details::ArrayTraits<T>, details::ArrayComparators<Sma
}
// Extracts the elements as std::vector.
- std::vector<T> promote() && {
+ std::vector<std::remove_const_t<T>> promote() && {
if (dynamic()) {
return std::get<Dynamic>(std::move(vector_)).promote();
} else {
@@ -290,11 +290,11 @@ template <typename T>
class SmallVector<T, 0> final : details::ArrayTraits<T>,
details::ArrayComparators<SmallVector>,
details::ArrayIterators<SmallVector<T, 0>, T>,
- std::vector<T> {
+ std::vector<std::remove_const_t<T>> {
using details::ArrayTraits<T>::replace_at;
using Iter = details::ArrayIterators<SmallVector, T>;
- using Impl = std::vector<T>;
+ using Impl = std::vector<std::remove_const_t<T>>;
friend Iter;
@@ -394,12 +394,12 @@ class SmallVector<T, 0> final : details::ArrayTraits<T>,
pop_back();
}
- std::vector<T> promote() && { return std::move(*this); }
+ std::vector<std::remove_const_t<T>> promote() && { return std::move(*this); }
private:
template <typename U, std::size_t M>
static Impl convert(SmallVector<U, M>&& other) {
- if constexpr (std::is_constructible_v<Impl, std::vector<U>&&>) {
+ if constexpr (std::is_constructible_v<Impl, std::vector<std::remove_const_t<U>>&&>) {
return std::move(other).promote();
} else {
SmallVector vector(other.size());