diff --git a/deps/ox/src/ox/std/initializerlist.hpp b/deps/ox/src/ox/std/initializerlist.hpp new file mode 100644 index 00000000..a55f5f48 --- /dev/null +++ b/deps/ox/src/ox/std/initializerlist.hpp @@ -0,0 +1,44 @@ +/* + * Copyright 2015 - 2021 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#if __has_include() +#include +#else + +#include "types.hpp" + +namespace std { + +template +class initializer_list { + private: + T *m_begin = nullptr; + size_t m_size = 0; + + public: + constexpr initializer_list() noexcept = default; + + constexpr size_t size() const noexcept { + return m_size; + } + + constexpr T *begin() const noexcept { + return m_begin; + } + + constexpr T *end() const noexcept { + return m_begin + m_size; + } + + private: + constexpr initializer_list(T *begin, size_t size) noexcept: m_begin(begin), m_size(size) {} +}; + +} + +#endif \ No newline at end of file diff --git a/deps/ox/src/ox/std/vector.hpp b/deps/ox/src/ox/std/vector.hpp index 31415acd..4d7a04f6 100644 --- a/deps/ox/src/ox/std/vector.hpp +++ b/deps/ox/src/ox/std/vector.hpp @@ -8,11 +8,8 @@ #pragma once -#if __has_include() -#include -#endif - #include "bit.hpp" +#include "initializerlist.hpp" #include "iterator.hpp" #include "math.hpp" #include "new.hpp"