[libcxx-commits] [PATCH] D115177: [libc++] [ranges] SFINAE-friendly "write it three times" in views::counted.
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 6 13:19:06 PST 2021
ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
================
Comment at: libcxx/include/__compare/weak_order.h:45-51
+ partial_ordering __po = (__t <=> __u);
+ if (__po == partial_ordering::less) {
+ return weak_ordering::less;
+ } else if (__po == partial_ordering::equivalent) {
+ return weak_ordering::equivalent;
+ } else if (__po == partial_ordering::greater) {
+ return weak_ordering::greater;
----------------
Please make those changes in a separate NFC patch. They really don't belong here.
================
Comment at: libcxx/include/__ranges/counted.h:38-41
template<class _From, class _To>
concept __explicitly_convertible = requires {
_To(_From{});
};
----------------
I think this can be removed now.
================
Comment at: libcxx/include/__ranges/counted.h:67
+ requires input_or_output_iterator<decay_t<_It>>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+ constexpr auto operator()(_It&& __it, _Diff&& __count) const
----------------
You're adding `[[nodiscard]]`. Please call it out in the commit message and add a test for it.
================
Comment at: libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp:17
#include <ranges>
#include <span>
----------------
`#include <memory>` for `addressof`, `<cstddef>` to `size_t`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115177/new/
https://reviews.llvm.org/D115177
More information about the libcxx-commits
mailing list