Use hidden friends for directory iterator comparisons
authorJonathan Wakely <jwakely@redhat.com>
Fri, 5 Apr 2019 16:56:31 +0000 (17:56 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 5 Apr 2019 16:56:31 +0000 (17:56 +0100)
commitdd4a309e05dc2ccde33e8e639aa063dc0c3b176f
treefcb73eaf3b2bdb495b2dcd5d39e0b1e79f9ab829
parent67087c7e53b64dc58a2440903275bd0b9db110df
Use hidden friends for directory iterator comparisons

The equality operators for directory iterators are not explicitly
specified in the standard, they're only required to meet the iterator
requirements. This means we don't need to declare them at namespace
scope and can implement them as hidden friends.

Also add 'noexcept' to directory_iterator's dereference operators.

* include/bits/fs_dir.h (directory_iterator::operator*)
(directory_iterator::operator->): Add noexcept.
(operator==, operator!=): Replace namespace-scope equality operators
for directory iterators with hidden friends.

From-SVN: r270175
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fs_dir.h