From: Jonathan Wakely Date: Fri, 21 Oct 2016 17:00:53 +0000 (+0100) Subject: LWG2707 init filesystem::path from string_type&& X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e59e183f69dcfac77e043854ca2ef37120c6eda1;p=gcc.git LWG2707 init filesystem::path from string_type&& * include/experimental/bits/fs_path.h (path::path(string_type&&)) (path::operator=(string&&), path::assign(string_type&&)): Define construction and assignment from string_type rvalues (LWG 2707). From-SVN: r241416 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fef7aa956f8..7fb055ded2b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2016-10-21 Jonathan Wakely + + * include/experimental/bits/fs_path.h (path::path(string_type&&)) + (path::operator=(string&&), path::assign(string_type&&)): Define + construction and assignment from string_type rvalues (LWG 2707). + 2016-10-21 Eelis van der Weegen * include/bits/stl_algo.h (__gen_two_uniform_ints): Move logic out diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index dab8ef0165e..4d7291f9f07 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -159,6 +159,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 __p.clear(); } + path(string_type&& __source) + : _M_pathname(std::move(__source)) + { _M_split_cmpts(); } + template> path(_Source const& __source) @@ -193,6 +197,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 path& operator=(const path& __p) = default; path& operator=(path&& __p) noexcept; + path& operator=(string_type&& __source); + path& assign(string_type&& __source); template _Path<_Source>& @@ -721,6 +727,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 return *this; } + inline path& + path::operator=(string_type&& __source) + { return *this = path(std::move(__source)); } + + inline path& + path::assign(string_type&& __source) + { return *this = path(std::move(__source)); } + inline path& path::operator+=(const path& __p) {