diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2018-12-12 16:13:49 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-12-12 16:13:49 +0000 |
commit | 9e160526440decfabecbe06e7ed22ee828d93010 (patch) | |
tree | 81f49981f5999dc6c0ecbbb872db30467b46e1d5 /gcc/go | |
parent | 6b7c0b5559316028d392d2bf9a4a0ca9e7562ce7 (diff) | |
download | gcc-9e160526440decfabecbe06e7ed22ee828d93010.zip gcc-9e160526440decfabecbe06e7ed22ee828d93010.tar.gz gcc-9e160526440decfabecbe06e7ed22ee828d93010.tar.bz2 |
Overload std::distance and std::advance for path::iterator
Although filesystem::path::iterator is only a bidirectional iterator,
the underlying sequence has random access iterators (specifically, raw
pointers). This means std::distance and std::advance can be implemented
more efficiently than the generic versions which apply ++ and --
repeatedly.
PR libstdc++/71044 (partial)
* include/bits/fs_path.h (__path_iter_distance, __path_iter_advance):
New friend functions to implement std::distance and std::advance more
efficiently.
(distance, advance): Add overloads for path::iterator.
* testsuite/27_io/filesystem/path/itr/components.cc: Test new
overload.
From-SVN: r267057
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions