1
0
Fork 0

Update include.hh

Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
subcrip 2024-06-10 17:11:50 +08:00
parent 3ffb8794f8
commit 49da897ccc
1 changed files with 9 additions and 0 deletions

View File

@ -476,4 +476,13 @@ public:
template <typename T> vector<pair<int, T>> enumerate(const vector<T>& container) {
return zip<int, T>(ArithmeticIterator<int>(0), ArithmeticIterator<int>(INT_MAX), container.begin(), container.end());
}
#define initarray(init, N) (__initarray<decay<decltype(init)>::type, (N)>(init))
template <typename T, size_t N>
array<T, N> __initarray(const T& init) {
array<T, N> res;
for (size_t i = 0; i < N; ++i) {
res[i] = init;
}
return res;
}
/////////////////////////////////////////////////////////