arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
InitializerList.h
1#pragma once
2
3#if __has_include("initializer_list")
4# include <initializer_list>
5#else
6
7namespace std {
13template<class _Ep>
14class initializer_list{
15 const _Ep* __begin_;
16 size_t __size_;
17
18 inline
19 constexpr
20 initializer_list(const _Ep* __b, size_t __s) noexcept
21 : __begin_(__b),
22 __size_(__s)
23 {}
24
25public:
26 typedef _Ep value_type;
27 typedef const _Ep& reference;
28 typedef const _Ep& const_reference;
29 typedef size_t size_type;
30
31 typedef const _Ep* iterator;
32 typedef const _Ep* const_iterator;
33
34 inline
35 constexpr
36 initializer_list() noexcept : __begin_(nullptr), __size_(0) {}
37
38 inline
39 constexpr
40 size_t size() const noexcept {return __size_;}
41
42 inline
43 constexpr
44 const _Ep* begin() const noexcept {return __begin_;}
45
46 inline
47 constexpr
48 const _Ep* end() const noexcept {return __begin_ + __size_;}
49};
50
51template<class _Ep>
52inline
53constexpr
54const _Ep*
55begin(initializer_list<_Ep> __il) noexcept{
56 return __il.begin();
57}
58
59template<class _Ep>
60inline
61constexpr
62const _Ep*
63end(initializer_list<_Ep> __il) noexcept{
64 return __il.end();
65}
66
67}
68
69#endif