-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
I am tempted to see whether we can introduce
__begin()and__end()functions instead, and get rid of__make_iterentirely. I'd imagine something likeiterator __begin() { return /* __make_iter(0); */ } iterator __end() { return /* __make_iter(_Size); */ } // and then here's an example usage // OLD: std::copy_backward(__base::__make_iter(0), __base::__make_iter(_Size - __pos), __base::__make_iter(_Size)); // NEW: std::copy_backward(__begin(), __end() - __pos, __end());Now the main question IMO is whether
__end() - __posproduces equivalent code. I think we'll end up calling, which might not produce efficient code. I still think we should investigate that since that looks like the way we'd want to write our code at a high level.llvm-project/libcxx/include/__bit_reference
Line 368 in 52f941a
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __bit_iterator& operator+=(difference_type __n) {
Originally posted by @ldionne in #121312 (comment)
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.