initial commit
This commit is contained in:
25
utils.hpp
Normal file
25
utils.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user