[libcxx-commits] [PATCH] D103273: [libc++] Update all the pre-defined iterator types for C++20

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 28 09:35:42 PDT 2021

Mordante accepted this revision as: Mordante.
Mordante added a comment.

LGTM! I'll leave the final approval for @Quuxplusone.

Comment at: libcxx/include/iterator:863
+#if _LIBCPP_STD_VER > 17
+    _LIBCPP_INLINE_VISIBILITY constexpr back_insert_iterator() noexcept = default;
Quuxplusone wrote:
> I strongly recommend removing the redundant `constexpr` and `noexcept`, for cleanliness' sake. (Defaulted functions are always constexpr-auto and noexcept-auto.)
> Ditto line 908, 1075, 1200; already OK on line 954.
I've no strong opinion about this, but I slight prefer to use the wording the standard provides. Thus including `constexpr` and `noexept`.

Comment at: libcxx/include/iterator:465
+    constexpr ostreambuf_iterator() noexcept = default; // since C++20
     ostreambuf_iterator(ostream_type& s) noexcept;
Quuxplusone wrote:
> ldionne wrote:
> > @tcanens I think this one is missing from cppreference: https://en.cppreference.com/w/cpp/iterator/ostreambuf_iterator/ostreambuf_iterator
> It'll be DRed out of existence by p2325r3, so I bet it's not worth fixing on cppreference.
> (See my LWG reflector thread of last week, "Must `ostreambuf_iterator<char>().failed() == false`?".)
> There's an executive design decision to be made here as to whether we should just go ahead and implement p2325 (although it seems like both me and Louis have relatively independently made decisions to implement not-p2325). Either p2325 or not-p2325 would suffice to unblock @mordante AIUI.
Yeah when P2325 is applied the default constructors will be removed, but an `output_iterator` should no longer require `default_constructible`.  For `<format>` I only need the `back_insert_iterator` to be an `output_iterator`.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list