| 3 | |
| 4 | template <typename T> |
| 5 | class initializer_list { |
| 6 | public: |
| 7 | using value_type = T; |
| 8 | using reference = const T&; |
| 9 | using const_reference = const T&; |
| 10 | using size_type = size_t; |
| 11 | using iterator = const T*; |
| 12 | using const_iterator = const T*; |
| 13 | |
| 14 | private: |
| 15 | const T* data_; |
| 16 | size_type size_; |
| 17 | |
| 18 | public: |
| 19 | // Default constructor (required for some compilers) |
| 20 | initializer_list() : data_(nullptr), size_(0) {} |
| 21 | |
| 22 | // Constructor from array (used internally by the compiler) |
| 23 | initializer_list(const T* data, size_type size) : data_(data), size_(size) {} |
| 24 | |
| 25 | // Member functions |
| 26 | size_type size() const { return size_; } |
| 27 | const_iterator begin() const { return data_; } |
| 28 | const_iterator end() const { return data_ + size_; } |
| 29 | }; |
| 30 | |
| 31 | #endif // INITIALIZER_LIST_HPP |
nothing calls this directly
no outgoing calls
no test coverage detected