DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Utils.h
Go to the documentation of this file.
1#pragma once
2#include <initializer_list>
3
7template <class T>
9 const std::initializer_list<T>& list;
10
13 _init_list_with_indexer(const std::initializer_list<T>& _list)
14 : list(_list) {
15 }
16
20 T operator[](unsigned int index) { return *(list.begin() + index); }
21};
_init_list_with_indexer(const std::initializer_list< T > &_list)
Constructs a wrapper over the provided initializer list.
Definition Utils.h:13
T operator[](unsigned int index)
Accesses the element at the specified index.
Definition Utils.h:20
const std::initializer_list< T > & list
Reference to the wrapped initializer list.
Definition Utils.h:9