I've stuck with compilation error related with operator=
.
error C2248: 'std::basic_ifstream<_Elem,_Traits>::operator =' : cannot access private member declared in class
'std::basic_ifstream<_Elem,_Traits>
Here's the code:
class A1 {
protected:
regex someValue;
public:
A1(){};
A1(const string & value_A ): someValue(value_A){};
};
class B2 : public A1 {
public:
B2(const char * value_B): A1(value_B){filewithResults.open("Output1.txt");};
ofstream filewithResults; // seems this parameter cause complatiion problems
};
int main(){
B2 object1 = B2("something1");
B2 object2 = B2("something2");
//then in program I assign object1 = object2;
}
result:
So seems public "ofstream filewithResults" cause problem. How to fit it ?
There is also releated to it error:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\fstream(1035) : see declaration of 'std::basic_ofstream<_Elem,_Traits>::operator ='
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> This diagnostic occurred in the compiler generated function 'B2 &B2::operator =(const B2 &)'