I have the following code in my header file:
class Factovisors {
public:
Factovisors(std::istream& strm):strm_(strm)
{
}
void run()
{
unsigned int n,m;
while (!strm_.eof()) {
strm_ >> n >> m;
if (isFact(n,m))
std::cout << m << " divides " << n << "!\n";
}
}
std::istream strm_;
};
My .cpp file has the following code.
std::ifstream strm("factovisor.test");
Factovisors facto(strm);
facto.run();
strm.close();
The error my compiler gives me is:
std::ios::basic_ios(const std::ios &) is not accessible from
std::istream::basic_istream(const std::istream &)
I imagine I am missing something really obvious. So any help would be greatly appreciated.