I have two classes that are functionally identical, but which I want to make separate so that the same class of object can be used in different constructors for another class. I decided to make my second class inherit from the first.
http://en.cppreference.com/w/cpp/language/initializer_list (initialization order)
To construct the derived class you need to construct the base class first. However, you do not have any call to a base class constructor in your initialization list.
The compiler guess that you want to use the default constructor for the base class, but in your case you do not have a default constructor, so it fails.
1 2
InputReader(std::istream &i): TextReader(i)
{}
> so that the same class of object can be used in different constructors for another class.
¿care to expand?
The classes function the same way but they're intended for different types of files. One is for save files while the other is for a sequence of scripts. Don't ask why I'm not using <fstream>.