CppQuickStart/utils.hpp

21 lines
556 B
C++
Raw Normal View History

2019-03-28 16:38:50 +01:00
#ifndef DEF_utils
#define DEF_utils
#include <ostream>
#define PRINT_VAR(x) std::cout << #x << "\t= " << (x) << "\n"
#define PRINT_VEC(x); {std::cout << #x << "\t= "; \
for(unsigned int i_print_vec = 0 ; i_print_vec < (x).size() ; i_print_vec++) \
std::cout << (x)[i_print_vec] << "\t"; \
std::cout << "\n";}
template<typename T, template<class,class...> class C, class... Args>
std::ostream& operator<<(std::ostream& os, const C<T,Args...>& objs)
{
for (auto const& obj : objs)
os << obj << ' ';
return os;
}
#endif