C++ Logo


Advanced search

Re: [SG16-Unicode] [isocpp-lib-ext] Proposed design change to P1030 filesystem::path_view

From: Niall Douglas <s_sourceforge_at_[hidden]>
Date: Tue, 27 Aug 2019 12:46:40 +0100
On 26/08/2019 20:28, Arthur O'Dwyer wrote:
> A path /*itself*/ is not a range of anything — it's just a path.
> std::filesystem::path breaks this intuition by giving
> std::filesystem::path ".begin()" and ".end()" methods, which causes C++
> to treat it like a range type. But that's just an example of "lying to
> the compiler." Giving .begin() and .end() methods to a C++ class type
> that does not itself /*represent*/ a range of elements was the original sin.

What ended up as std::filesystem::path underwent many peer reviews at
Boost. If I remember rightly, path's ideal design was one of the most
contentious parts of those reviews. It sharply divided expert opinion,
and Beman completely redid the design based on that feedback at least once.

Would I personally have designed filesystem::path differently? Absolutely.

Would every single person at Boost have designed filesystem::path
differently? Absolutely.

Did the present filesystem::path design reach a point where everybody in
the room didn't completely hate it? Indeed it did. And that is what's in
the standard today.

Committees very rarely achieve perfect design, but they do by definition
reach an acceptable design. That is std::filesystem::path, warts and all.


Received on 2019-08-27 13:46:45