template(generic type) and io stream