// -*- C++ -*-
#ifndef _EZCXX_INITIALIZER_LIST
#define _EZCXX_INITIALIZER_LIST

#pragma clang system_header

#include <__config>
#include <cstddef>

namespace std {

template<class _Ep>
class initializer_list {
public:
    using value_type = _Ep;
    using reference = _Ep&;
    using const_reference = _Ep const&;
    using size_type = size_t;
    using iterator = const _Ep*;
    using const_iterator = const _Ep*;

private:
    iterator __begin;
    size_type __size;

    _EZCXX_INLINE constexpr initializer_list(const_iterator __begin, size_type __size) noexcept : __begin(__begin), __size(__size) {}

public:
    _EZCXX_INLINE constexpr initializer_list() noexcept : initializer_list(nullptr, 0) {}

    _EZCXX_INLINE constexpr size_type size() const noexcept { return __size; }

    _EZCXX_INLINE constexpr const_iterator begin() const noexcept { return __begin; }

    _EZCXX_INLINE constexpr const_iterator end() const noexcept { return __begin + __size; }
};

template<class _Ep>
_EZCXX_INLINE constexpr const _Ep* begin(initializer_list<_Ep> __il) noexcept { return __il.begin(); }

template<class _Ep>
_EZCXX_INLINE constexpr const _Ep* end(initializer_list<_Ep> __il) noexcept { return __il.end(); }

} // namespace std

#endif // _EZCXX_INITIALIZER_LIST
