Consider my overloaded operator
Code:
std::istream& operator >> (std::istream& in, Contract& contract)
{
std::string contractNo;
std::string rentalType;
unsigned lenderID;
unsigned carReg;
in >> contractNo;
in >> lenderID;
in >> carReg;
in >> rentalType;
// Error on below : error C2228: left of '.SetDate' must have class/struct/union
Contract::issued.SetDate( Date::getCurrentTime() );
contract.SetContractDetails(issued, carReg, rentalType,
lenderID, contractNo);
return in;
}
This operator is a free function within Contract.h file and issued is declared inside the Contract class as private
Code:
#include "Date.h"
class Contract
{
public:
Contract();
private:
Date issued, returned;
};
std::istream& operator >> (std::istream& in, Contract& rental);
How do i access SetDate() properly?