Why don't the std::fstream classes take a std::string?

后端 未结 10 789
花落未央
花落未央 2020-11-28 07:25

This isn\'t a design question, really, though it may seem like it. (Well, okay, it\'s kind of a design question). What I\'m wondering is why the C++ std::fstream

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 07:27

    I believe that this has been thought about and was done to avoid the dependency; i.e. #include should not force one to #include .

    To be honest, this seems like quite an inconsequential issue. A better question would be, why is std::string's interface so large?

提交回复
热议问题