title: fstream initialization as a class
body: <p>before you mark it as duplicate, I have already read the following <a href="https://stackoverflow.com/questions/8994157/how-to-instantiate-an-fstream-if-you-declare-it-as-a-member-of-a-class">Q&amp;A</a>.</p>
  
  <p>I have a simple Class called ATM:</p>
  
  <p>ATM.h</p>
  
  <pre><code>class ATM {
  public:
      ATM(Bank* ownerBank, const char* inputFile);
      ~ATM();
      void performSingleATMAction();
      friend void* performSingleATMActionFunc(void* pVoidATM);
  private:
      Bank* ownerBank;
      string inputFile;
      fstream fileReader;
      Thread mainThread;
      static const unsigned int ATM_SLEEP_TIME = 1000*100;
  };
  </code></pre>
  
  <p>I try to initialize it via initialization list:</p>
  
  <pre><code>ATM::ATM(Bank* ownerBank, const char* inputFile) :
  ownerBank(ownerBank),
  inputFile(inputFile), 
  fileReader(inputFile,std::ifstream::in), // why copy constructor?
  mainThread(performSingleATMActionFunc,this)
  {}
  </code></pre>
  
  <p>the line
  <code>fileReader(inputFile,std::ifstream::in)</code> </p>
  
  <p>somehow invokes the copy constructor.. which is private </p>
  
  <p>any help?</p>