summaryrefslogtreecommitdiff
path: root/AK/Vector.h
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2022-01-03 03:29:58 -0800
committerAndreas Kling <kling@serenityos.org>2022-01-05 14:04:18 +0100
commit1a2aad287f43f1081810772c9792eb2a20c07ed5 (patch)
treee8a7f4667e8c52e28e01e732f6a6f72af1db2c70 /AK/Vector.h
parent538986c99172aa1c7759b25b9600613f1fbe1582 (diff)
downloadserenity-1a2aad287f43f1081810772c9792eb2a20c07ed5.zip
AK: Disable Vector insert/empend/prepend + a append overload in Kernel
We have whittled away at the usages of these AK::Vector APIs in the Kernel. This change disables them from being visible when building the Kernel to make sure no new usages get added.
Diffstat (limited to 'AK/Vector.h')
-rw-r--r--AK/Vector.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/AK/Vector.h b/AK/Vector.h
index 327be79be8..d04b34f83d 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -202,6 +202,8 @@ public:
return false;
}
+#ifndef KERNEL
+
template<typename U = T>
void insert(size_t index, U&& value) requires(CanBePlacedInsideVector<U>)
{
@@ -224,6 +226,8 @@ public:
MUST(try_extend(other));
}
+#endif
+
ALWAYS_INLINE void append(T&& value)
{
if constexpr (contains_reference)
@@ -237,10 +241,12 @@ public:
MUST(try_append(T(value)));
}
+#ifndef KERNEL
void append(StorageType const* values, size_t count)
{
MUST(try_append(values, count));
}
+#endif
template<typename U = T>
ALWAYS_INLINE void unchecked_append(U&& value) requires(CanBePlacedInsideVector<U>)
@@ -262,6 +268,7 @@ public:
m_size += count;
}
+#ifndef KERNEL
template<class... Args>
void empend(Args&&... args) requires(!contains_reference)
{
@@ -284,6 +291,8 @@ public:
MUST(try_prepend(values, count));
}
+#endif
+
// FIXME: What about assigning from a vector with lower inline capacity?
Vector& operator=(Vector&& other)
{