I was wondering if it is possible to have overload the C++ >> operator in this way
Account& operator>> (double left, Account &right)
{
right.deposit(left);
return right;
}
Account& operator>> (Account &left, double right)
{
left.withdraw(right);
return left;
}
I was wondering if the >> operator had this functionality so I could do something like this
account1 >> 200 >> account2
Which would withdraw 200 from the first account and then deposit it into the second account.