Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    Do you also think that std::string should have more member functions? Commented Mar 27, 2017 at 17:59
  • IIUC P0317R1 makes it possible to write directory_entry(p).file_size(). Commented Mar 27, 2017 at 18:02
  • 4
    Whoever taught you that C++ is an OO language is wrong. Also, see stackoverflow.com/questions/5989734/… and drdobbs.com/cpp/how-non-member-functions-improve-encapsu/… and stackoverflow.com/questions/1692084/… and gotw.ca/gotw/084.htm Commented Mar 27, 2017 at 19:16
  • 3
    It's entirely possible to write large C++ programs that never use virtual functions and dynamic polymorphism, or even inheritance. And simply making everything a member function of a class isn't "OO" anyway! So although you can use C++ to write OO code, the language itself is not an OO language, and your understanding of OO seems flawed. Using member functions != OOP. Finally, take note of the last paragraph of stroustrup.com/bs_faq.html#oop which says 'Please note that object-oriented programming is not a panacea. "OOP" does not simply mean "good"' Commented Mar 28, 2017 at 10:49
  • 2
    auto n = std::filesystem::file_size(p); should read auto n = file_size(p); ADL is guaranteed to find file_size and consider it. Commented Apr 3, 2017 at 3:12