Hi i have a little wierd question here,on overloading operators outside classes, for me it seems impossible and unheard of, if possible i will certainly like it coz am really in need of such a function, see below
template<typename T>
/**actually i dont know what to return**/
/**type**/ input(istream& in,T my_var)
{
///some code here
///stuff like stream checks,input validation,many more
}
//if the ffunction is defined i could use it like this
int main()
{
string temp, data,data1;
int temp,val;
vector<int> myvec;
input(cin,temp)>>data;
input(cin,temp)>>data1;//like this
for(int i=0;i<10;i++)
{
myvec.push_back(input(cin,temp)>>val);//all this miracles
}
}
thats what i was talking about "haha", is it really possible?