filesystem icon indicating copy to clipboard operation
filesystem copied to clipboard

Use ghc::filesystem as a substitute for std::filesystem transparently?

Open kencu opened this issue 1 year ago • 1 comments

Is there some way that a build written to use std::filesystem:: calls might transparently substitute ghc::filesystem:: calls without patching the code?

kencu avatar Mar 10 '24 20:03 kencu

If the calling code is already build, in other words for a binary, that is impossible, as it is not link compatible, also formally the standard doesn't allow putting own stuff into the std namespace (besides template specializations like for e.g. std::swap), so while there might be hacks to get there (maybe using the required types inside of a std namespace) it is undefined behavior and thus not an option in the scope of this project. Additionally the documented differences might come into play if the code depends on exact behavior.

gulrak avatar Mar 11 '24 13:03 gulrak