These new comparison operators for std::default_sentinel_t require some
new symbol exports, which were added with
r13-5662-gdb8d6fc572ec31 for
trunk, but that isn't suitable for the gcc-12 branch.
Define them as specified in the standard instead, which doesn't require
any new symbols.
libstdc++-v3/ChangeLog:
* include/bits/fs_dir.h (directory_iterator::operator==):
Define without using a non-exported shared_ptr symbol.
(recursive_directory_iterator::operator==): Likewise.
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3719. Directory iterators should be usable with default sentinel
bool operator==(default_sentinel_t) const noexcept
- { return !_M_dir; }
+ { return *this == directory_iterator(); }
#endif
#if __cpp_impl_three_way_comparison < 201907L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3719. Directory iterators should be usable with default sentinel
bool operator==(default_sentinel_t) const noexcept
- { return !_M_dirs; }
+ { return *this == recursive_directory_iterator(); }
#endif
#if __cpp_impl_three_way_comparison < 201907L