add template<typename CharT> for iostream