Hi all, im doing an assignment for school and have bumped into this error that I been working at the past 4 hours without success
first of all a little background knowledge, there are two classes in this , Record and Database and i'll include the private datas here
template <typename Value> class Database
private:
std::list< Record<Value> > dRecords;
int sRecord;
public of concerned
void read(std::istream& in);
template <typename Value> class Record
public
friend std::istream& operator>><>(std::istream& in, Record<Value>& r); ->tested to be working fine
private:
std::vector<std::pair<std::string, Value> > record_;
bool selected;
this is the problem im stuck with :
template <typename Value>
void Database<Value>::read(std::istream& in){
dRecords.clear();
while(in.peek()!=EOF){
Record<Value> temp;
in>>temp;
dRecords.push_back(temp);
}
}
overloaded operator >> stops at a certain condition (like meeting a character" and so my question is in consist of alot of repeated input that should have been called onto different Record object, but my in>>temp from what i observed throws everything into the current object even after breaking from the >> function (it just call the same object's >> function again after exiting it)
hope someone can help, thx alot