diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-05-10 14:09:22 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-05-10 14:09:22 +0100 |
commit | 77a87b2a0e5fb069107479d1e2bd3efafd6bd3ab (patch) | |
tree | 7ab45535d9fd373319c8d6850890c935d6fab85f /libstdc++-v3 | |
parent | da7c9950d5a6a2106fc73f5e2056687f48f4dd5f (diff) | |
download | gcc-77a87b2a0e5fb069107479d1e2bd3efafd6bd3ab.zip gcc-77a87b2a0e5fb069107479d1e2bd3efafd6bd3ab.tar.gz gcc-77a87b2a0e5fb069107479d1e2bd3efafd6bd3ab.tar.bz2 |
Optimize __directory_iterator_proxy for the common case
* include/experimental/bits/fs_dir.h (__directory_iterator_proxy):
Overload operator* to move from rvalues.
From-SVN: r236078
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/bits/fs_dir.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 20c55ff..7aaeefa 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2016-05-10 Jonathan Wakely <jwakely@redhat.com> + * include/experimental/bits/fs_dir.h (__directory_iterator_proxy): + Overload operator* to move from rvalues. + PR libstdc++/71036 * src/filesystem/ops.cc (create_dir): Handle EEXIST from mkdir. * testsuite/experimental/filesystem/operations/create_directory.cc: diff --git a/libstdc++-v3/include/experimental/bits/fs_dir.h b/libstdc++-v3/include/experimental/bits/fs_dir.h index 5fd41c2..011d398 100644 --- a/libstdc++-v3/include/experimental/bits/fs_dir.h +++ b/libstdc++-v3/include/experimental/bits/fs_dir.h @@ -158,7 +158,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 struct __directory_iterator_proxy { - const directory_entry& operator*() const noexcept { return _M_entry; } + const directory_entry& operator*() const& noexcept { return _M_entry; } + + directory_entry operator*() && noexcept { return std::move(_M_entry); } private: friend class directory_iterator; |