Pass std::cin as a parameter?

For some reason, when I try to create a function like this:
vector<Variable> tokenize(string full, Environment& env, LexerType largs=NOARGS, std::istream source=std::cin);
And call it like this:
vector<Variable>tvar=tokenize(full.substr(1,ccount),env,DISABLESCOPE);
I get this error:
781 C:\Program Files (x86)\Dev-Cpp\include\c++\3.4.5\bits\ios_base.h `std::ios_base::ios_base(const std::ios_base&)' is private

In the context of the second line of code.
This is annoying, as I can't think of any other way to do what I need, which is get input from some stream, be it a file or cin.
Is there way way to do this simply?
Streams cannot be copied. Declare 'source' as a reference.
Great, that fixed it. Thank you!
Topic archived. No new replies allowed.