diff options
-rw-r--r-- | .github/workflows/unittests_windows.yml | 2 | ||||
-rw-r--r-- | include/llfio/v2.0/path_view.hpp | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/.github/workflows/unittests_windows.yml b/.github/workflows/unittests_windows.yml index 9b3b4cdb..e1938924 100644 --- a/.github/workflows/unittests_windows.yml +++ b/.github/workflows/unittests_windows.yml @@ -30,7 +30,7 @@ jobs: if [ "${{ matrix.configuration }}" = "status_code" ]; then export CMAKE_CONFIGURE_OPTIONS="-DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON" fi - ctest -S .ci.cmake -VV --timeout 900 "-DCTEST_CONFIGURE_OPTIONS=$CMAKE_CONFIGURE_OPTIONS" -DCTEST_SITE=$NAME -DCTEST_CMAKE_GENERATOR="Visual Studio 15 2019 Win64" + ctest -S .ci.cmake -VV --timeout 900 "-DCTEST_CONFIGURE_OPTIONS=$CMAKE_CONFIGURE_OPTIONS" -DCTEST_SITE=$NAME -DCTEST_CMAKE_GENERATOR="Visual Studio 15 2017 Win64" - name: Upload Prebuilt Binaries uses: actions/upload-artifact@v2 diff --git a/include/llfio/v2.0/path_view.hpp b/include/llfio/v2.0/path_view.hpp index 98e0f710..8c0df8b4 100644 --- a/include/llfio/v2.0/path_view.hpp +++ b/include/llfio/v2.0/path_view.hpp @@ -1198,6 +1198,19 @@ public: { _init(view, output_zero_termination, nullptr, _default_allocate<AllocatorOrDeleter>(&_deleter2)); } + //! Construct from a compatible `c_str`. + LLFIO_TEMPLATE(class AllocatorOrDeleter2, size_t _internal_buffer_size2) + LLFIO_TREQUIRES(LLFIO_TPRED(!std::is_same<c_str, c_str<T, AllocatorOrDeleter2, _internal_buffer_size2>>::value), + LLFIO_TPRED(std::is_constructible<AllocatorOrDeleter, AllocatorOrDeleter2>::value)) + explicit c_str(c_str<T, AllocatorOrDeleter2, _internal_buffer_size2> &&o) noexcept + : buffer(o.buffer) + , length(o.length) + , _bytes_to_delete(o._bytes_to_delete) + , _deleter1(o._deleter1) + , _deleter1arg(o._deleter1arg) + , _deleter2(std::move(o._deleter2)) + { + } ~c_str() { reset(); } c_str(const c_str &) = delete; c_str(c_str &&o) noexcept |