let us assume I have a class with
#include
using namespace std;
class Test{
public:
friend istream& operator >> (istr
You can't. Streams are something you read from, they are not factories or something like that.
You have several choices, though:
Read from the stream to a non-const, and then use that to initialize your const object
You can make dummy non-const, initialize your object as unread, and then read into dummy; then you can pass outside only const& to dummy