std::to_str: Use .iter() for HashMap and HashSet