[libcxx-commits] [PATCH] D102037: [libcxx][views] Add drop_view.

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 21 18:42:41 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/include/__ranges/drop_view.h:133
+    constexpr auto size()
+      requires sized_range<_View>
+    { return __size(*this); }
----------------
Quuxplusone wrote:
> cjdb wrote:
> > Please line up requires-clauses with the start of the function declaration. Small clause (such as this) can go on the same line.
> > 
> > I've usually turned a blind eye to this because comments about formatting are noise that lead to unproductive debates, and my intention has been to get clang-format to take care of this inconsistency in one fell swoop. Having said that, since I don't know when I'll be able to apply the tool project-wide and not get something weird, it's probably worth adopting the "official" libc++ style for future contributors' sakes.
> FWIW, I agree about "unproductive debates" ;) but if there's an official libc++ style, it's always been "indent the subordinate clause by one level."
> ```
> template<class T>
>   requires foo<T>
> auto bar()
>   -> decltype(baz)
> {
>   return quux;
> }
> ```
> I don't think your insistence on following clang-format's (broken) formatting guidance here is helpful to the project. I predict that clang-format will eventually implement C++20 formatting, and then it'll be good that Zoe's been following the "indent requires-clauses" style.
[[ https://reviews.llvm.org/D99691#inline-938990 | Louis gave me creative freedom ]] to set the style for requires-clauses. [[ https://reviews.llvm.org/D99691#inline-939014 |  I made the decision that they wouldn't be indented ]].


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102037/new/

https://reviews.llvm.org/D102037



More information about the libcxx-commits mailing list