Remove non-Standard <experimental/filesystem> by StephanTLavavej · Pull Request #5765 · microsoft/STL (original) (raw)

Overview

This permanently removes our non-Standard <experimental/filesystem> header, which was superseded by C++17 <filesystem>.

For 6 years (VS 2019 16.3 in September 2019), <experimental/filesystem> has been "hard deprecated" with an impossible-to-ignore compiler error telling users that "The <experimental/filesystem> header providing std::experimental::filesystem is deprecated by Microsoft and will be REMOVED." It's finally time to deliver on that promise. (Also, the name inherently indicated that the technology was tentative and not eternal.)

Eliminating this code removes unnecessary complexity from this fiendishly complex library. For users, it removes ways to write non-portable code. For library implementers, it slightly reduces our maintenance burden, making it easier for us to reason about the remaining Standard code.

The interface of <experimental/filesystem> is fairly close to that of Standard <filesystem>, making migration easy in most cases. However, the implementation of <experimental/filesystem> was riddled with deficiencies and limitations (including MAX_PATH limitations). This is a major reason to push users to migrate to Standard <filesystem>, whose implementation was written from scratch to be conforming. Unfortunately, we can't completely remove the <experimental/filesystem> implementation, as its separately compiled component must be retained for binary compatibility. But we can still remove the header itself, and some support logic in other headers.

Because of the retained-for-bincompat caveat, I am preserving test coverage for <experimental/filesystem>. Most of our retained-for-bincompat functions have no test coverage, and we simply rely on not changing them, but the implementation of <experimental/filesystem> was large and complicated enough that I think preserving test coverage is worth the effort.

Commits