Files
DSA/utils.hpp
2024-10-04 16:11:55 -05:00

26 lines
523 B
C++

#ifndef H_A8A1FCC0D9024403B10B2B58FDE2112E
#define H_A8A1FCC0D9024403B10B2B58FDE2112E
#include <iterator>
#include <iostream>
//TODO fix trailing comma
template <typename T>
void arrayprint(T begin, T end)
{
std::cout << '[';
auto it = begin;
auto next = std::next(it, 1);
while (it != end)
{
std::cout << *it;
if (next != end)
std::cout << ',';
it = next;
next = std::next(it, 1);
}
std::cout << ']';
}
#endif //H_A8A1FCC0D9024403B10B2B58FDE2112E