Without the wrap, paths can flee the "fs-jail".
For example, the following compiles on current master:
diff --git a/src/test/fs_tests.cpp b/src/test/fs_tests.cpp
index 5875f0218f..04eef9f5c6 100644
--- a/src/test/fs_tests.cpp
+++ b/src/test/fs_tests.cpp
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(fsbridge_pathtostring)
{
std::string u8_str = "fs_tests_₿_🏃";
BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(u8_str)), u8_str);
- BOOST_CHECK_EQUAL(fs::u8path(u8_str).u8string(), u8_str);
+ BOOST_CHECK_EQUAL(fs::u8path(u8_str).string(), u8_str);
BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).u8string(), u8_str);
BOOST_CHECK_EQUAL(fs::PathToString(fs::u8path(u8_str)), u8_str);
#ifndef WIN32
After this pull, it will fail, as expected:
test/fs_tests.cpp:22:42: error: attempt to use a deleted function
BOOST_CHECK_EQUAL(fs::u8path(u8_str).string(), u8_str);
^
./fs.h:52:17: note: 'string' has been explicitly marked deleted here
std::string string() const = delete;
^
1 error generated.
make[2]: *** [Makefile:17833: test/test_bitcoin-fs_tests.o] Error 1