void isRegistered(std::list<User>* usersList, std::list<User>::iterator& v, std::string username, std::string password){
std::fstream userfile = openFile("users.csv");
readUsers(userfile, usersList); // this line
readUsers(std::fstream file, std::list<User>* usersList) and reads whatever is in the csv file into usersList
on the second line I am getting fstream cannot be referenced -- it is a deleted function error. I can't seem to figure out why any help would be appreciated
Full error:
function "std::basic_fstream<_Elem, _Traits>::basic_fstream(const std::basic_fstream<_Elem, _Traits> &) [with _Elem=char, _Traits=std::char_traits]" (declared at line 1273 of "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\VC\TOOLS\MSVC\14.28.29910\INCLUDE\fstream") cannot be referenced -- it is a deleted functionC/C++(1776)
readUsers? Does it take the stream argument by value? Streams can't be copied, you have to pass by reference. - Some programmer dudestd::fstreamcopy-constructor is deleted. As I stated before, you must pass streams by reference. - Some programmer dude