istream/ostream base type checking