Commit e59e183f by Jonathan Wakely Committed by Jonathan Wakely

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
parent 67a6cac7
2016-10-21 Jonathan Wakely <jwakely@redhat.com>
* 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 <eelis@eelis.net> 2016-10-21 Eelis van der Weegen <eelis@eelis.net>
* include/bits/stl_algo.h (__gen_two_uniform_ints): Move logic out * include/bits/stl_algo.h (__gen_two_uniform_ints): Move logic out
......
...@@ -159,6 +159,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -159,6 +159,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
__p.clear(); __p.clear();
} }
path(string_type&& __source)
: _M_pathname(std::move(__source))
{ _M_split_cmpts(); }
template<typename _Source, template<typename _Source,
typename _Require = _Path<_Source>> typename _Require = _Path<_Source>>
path(_Source const& __source) path(_Source const& __source)
...@@ -193,6 +197,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -193,6 +197,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
path& operator=(const path& __p) = default; path& operator=(const path& __p) = default;
path& operator=(path&& __p) noexcept; path& operator=(path&& __p) noexcept;
path& operator=(string_type&& __source);
path& assign(string_type&& __source);
template<typename _Source> template<typename _Source>
_Path<_Source>& _Path<_Source>&
...@@ -722,6 +728,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 ...@@ -722,6 +728,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
} }
inline path& 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) path::operator+=(const path& __p)
{ {
return operator+=(__p.native()); return operator+=(__p.native());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment