Makes difference_type = std::ptrdiff_t and removes parent.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
libcxx/include/iterator | ||
---|---|---|
770–776 |
libcxx/include/iterator | ||
---|---|---|
770–776 | Ah yes I forgot about that discussion. Would it be better to just add a dummy base class that we inherit from in ABI-stable mode after C++17? |
libcxx/include/iterator | ||
---|---|---|
770–776 |
Yes, iff that base class is spelled iterator<output_iterator_tag, void, void, void, void>. Anything else would be an ABI break.
|
Thanks for working on this!
libcxx/include/iterator | ||
---|---|---|
770–776 | I'm also in favour of adding an ABI flag.
|
libcxx/include/iterator | ||
---|---|---|
770–776 |
🤷 Jason Turner noted that in his (relatively biased) survey on breaking ABI, no one seemed to flag that ABI stability was important to them, personally (link to video). Perhaps we should survey our users and find out
I'd say that users who care about ABI stability should enable macros that they care about. Unlike the nodiscard discussion, ABI stability is something that should be opt-in, because it lets us conform to the latest standard while also preserving something that "users" supposedly care about. Perhaps _LIBCPP_ABI_NO_CXX17_EMPTY_ITERATOR_BASE for this one, and _LIBCPP_ABI_NO_EMPTY_BASES as a general control mechanism for all the empty base deletions. We could also have _LIBCPP_NO_CXX17_ABI_BREAK (to be bikeshedded) that controls all _LIBCPP_ABI_NO_CXX17_* macros, in case users want to preserve stability with C++14. This idea is far from fleshed out, and deserves more discussion on Discord.
I think we can do this with more fine grained macros and libcxx tests. |
libcxx/include/iterator | ||
---|---|---|
775 | It seems the class also got a default constructor in C++20. Can you add _LIBCPP_INLINE_VISIBILITY constexpr back_insert_iterator() noexcept = default;? |
It seems the class also got a default constructor in C++20. Can you add _LIBCPP_INLINE_VISIBILITY constexpr back_insert_iterator() noexcept = default;?
Please also update the synopsis and front_insert_iterator? With these changes I can use the std::back_insert_iterator in std::format :-)