mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
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.
This commit is contained in:
parent
538986c991
commit
1a2aad287f
Notes:
sideshowbarker
2024-07-17 21:36:00 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/1a2aad287f4 Pull-request: https://github.com/SerenityOS/serenity/pull/11588
@ -202,6 +202,8 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KERNEL
|
||||||
|
|
||||||
template<typename U = T>
|
template<typename U = T>
|
||||||
void insert(size_t index, U&& value) requires(CanBePlacedInsideVector<U>)
|
void insert(size_t index, U&& value) requires(CanBePlacedInsideVector<U>)
|
||||||
{
|
{
|
||||||
@ -224,6 +226,8 @@ public:
|
|||||||
MUST(try_extend(other));
|
MUST(try_extend(other));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
ALWAYS_INLINE void append(T&& value)
|
ALWAYS_INLINE void append(T&& value)
|
||||||
{
|
{
|
||||||
if constexpr (contains_reference)
|
if constexpr (contains_reference)
|
||||||
@ -237,10 +241,12 @@ public:
|
|||||||
MUST(try_append(T(value)));
|
MUST(try_append(T(value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KERNEL
|
||||||
void append(StorageType const* values, size_t count)
|
void append(StorageType const* values, size_t count)
|
||||||
{
|
{
|
||||||
MUST(try_append(values, count));
|
MUST(try_append(values, count));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename U = T>
|
template<typename U = T>
|
||||||
ALWAYS_INLINE void unchecked_append(U&& value) requires(CanBePlacedInsideVector<U>)
|
ALWAYS_INLINE void unchecked_append(U&& value) requires(CanBePlacedInsideVector<U>)
|
||||||
@ -262,6 +268,7 @@ public:
|
|||||||
m_size += count;
|
m_size += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KERNEL
|
||||||
template<class... Args>
|
template<class... Args>
|
||||||
void empend(Args&&... args) requires(!contains_reference)
|
void empend(Args&&... args) requires(!contains_reference)
|
||||||
{
|
{
|
||||||
@ -284,6 +291,8 @@ public:
|
|||||||
MUST(try_prepend(values, count));
|
MUST(try_prepend(values, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// FIXME: What about assigning from a vector with lower inline capacity?
|
// FIXME: What about assigning from a vector with lower inline capacity?
|
||||||
Vector& operator=(Vector&& other)
|
Vector& operator=(Vector&& other)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user