The code fails to compile using the LLVM MinGW toolchain.
When building with libc++ that has LWG 3430 implemented, constructing std::ifstream
or std::ofstream
from an fs::path
object triggers its implicit conversion to std::string
. This behavior has been undesirable ever since fs::path
was introduced. See, for example: https://github.com/bitcoin/bitcoin/blob/a33bd767a37dccf39a094d03c2f62ea81633410f/src/util/fs.h#L54-L55