What's the most idotomatic way of declaring two constructors with the same args?
问题 As an example lets say I have a class called File . Now file can be opened as binary or text. My constructor is currently File(const char*filename) . Let's suppose the implementation of open is completely different binary and text. How the heck do I construct this? I thought about using a static function but I don't want to return a pointer. I could pass in a pointer but I rather not allow a class be constructed without actually initializing it. I was thinking about having an enum or bool in