#include "./unit.h" #include namespace std { template inline ostream& operator<<(ostream& o, const kelun::unit_base& ele){ o< struct unit_print_impl { static_assert(is_always_false, "Template type not supported"); }; template struct unit_print_impl,unit_base...> { static std::ostream& print(std::ostream& o){ unit_base element; std::ostream& o_ret = o << element; if constexpr (sizeof...(UnitTL) > 0){ std::ostream& o_ret_next = o_ret << ' ' << '*' << ' '; return unit_print_impl...>::print(o_ret_next); } return o_ret<<']'; } }; } namespace std { template inline ostream& operator<<(ostream& o, const kelun::unit& unit); template inline ostream& operator<<(ostream& o, const kelun::unit...>& unit){ o << unit.data(); if constexpr (sizeof...(UnitT) > 0) { auto& o_ret = o << ' '<<'['; return kelun::unit_print_impl...>::print(o_ret); } return o; } }