mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
Revert "AK: Add InitializerList, an implementation of std::initializer_list"
This reverts commit 0a2cab0928
.
This commit is contained in:
parent
bded472ec4
commit
b55b26a2bc
2 changed files with 10 additions and 78 deletions
14
AK/Vector.h
14
AK/Vector.h
|
@ -33,13 +33,17 @@
|
|||
#include <AK/Traits.h>
|
||||
#include <AK/kmalloc.h>
|
||||
|
||||
#ifdef __serenity__
|
||||
# include <AK/InitializerList.h>
|
||||
#else // !__serenity__
|
||||
# include <new>
|
||||
// NOTE: We can't include <initializer_list> during the toolchain bootstrap,
|
||||
// since it's part of libstdc++, and libstdc++ depends on LibC.
|
||||
// For this reason, we don't support Vector(initializer_list) in LibC.
|
||||
#ifndef SERENITY_LIBC_BUILD
|
||||
# include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifndef __serenity__
|
||||
# include <new>
|
||||
#endif
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename VectorType, typename ElementType>
|
||||
|
@ -140,12 +144,14 @@ public:
|
|||
clear();
|
||||
}
|
||||
|
||||
#ifndef SERENITY_LIBC_BUILD
|
||||
Vector(std::initializer_list<T> list)
|
||||
{
|
||||
ensure_capacity(list.size());
|
||||
for (auto& item : list)
|
||||
unchecked_append(item);
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector(Vector&& other)
|
||||
: m_size(other.m_size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue