]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Use feature test macros consistently in <bits/stl_iterator.h>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 14 Nov 2024 09:58:41 +0000 (09:58 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 14 Nov 2024 15:39:03 +0000 (15:39 +0000)
commite56d183c1590962a3029f84d411cb635e6611f1a
treeaf17dee9f27a4a947a8e87a041ea40219212fcbb
parent28854cf68dc4ad1ce5a72440d1422cb2bb02dd62
libstdc++: Use feature test macros consistently in <bits/stl_iterator.h>

Remove __cplusplus > 201703L checks that are redundant when used
alongside __glibcxx_concepts checks, because <version> already
guarantees that __glibcxx_concepts is only defined for C++20 and later.

Prefer to check __glibcxx_ranges for features such as move_sentinel that
were added by the One Ranges proposal (P0896R4), or for features which
depend on other components introduced by that proposal.

But prefer to check __glibcxx_concepts for constraints that only depend
on requires-clauses and concepts defined in <concepts>, even if those
constraints were added by the Ranges proposal (e.g. the constraints on
non-member operators for move_iterator).

Prefer #ifdef to #if when just testing for the presence of __glibcxx_foo
macros with caring about their value.

Also add/tweak some Doxygen comments.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h: Make use of feature test macros
more consistent. Improve doxygen comments.
libstdc++-v3/include/bits/stl_iterator.h