[libcxx-commits] [PATCH] D116234: [libc++][NFC] Reformat <__filesystem/operations.h>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 23 14:04:33 PST 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__filesystem/operations.h:371-372
 
-inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path() {
-  return __temp_directory_path();
-}
-
-inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path(error_code& __ec) {
-  return __temp_directory_path(&__ec);
-}
+inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path()                 { return __temp_directory_path(); }
+inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path(error_code& __ec) { return __temp_directory_path(&__ec); }
 
----------------
philnik wrote:
> Quuxplusone wrote:
> > For all of these `inline` one-liners, I'd strongly prefer that they be formatted consistently. I don't have a strong preference for
> > ```
> > inline _LIBCPP_HIDE_FROM_ABI function header() { return oneliner; }
> > ```
> > versus
> > ```
> > inline _LIBCPP_HIDE_FROM_ABI
> > function header() { return oneliner; }
> > ```
> > versus
> > ```
> > inline _LIBCPP_HIDE_FROM_ABI function header()
> >   { return oneliner; }
> > ```
> > versus
> > ```
> > inline _LIBCPP_HIDE_FROM_ABI function header() {
> >   return oneliner;
> > }
> > ```
> > versus
> > ```
> > inline _LIBCPP_HIDE_FROM_ABI
> > function header() {
> >   return oneliner;
> > }
> > ```
> > but let's be consistent. Also, if we choose anything other than the first option (all-on-one-source-line), then let's add one blank line after each function, so they don't all run together visually.
> Do you mean by the first one "ignore any line length limitation and put them in a single line"?
> Do you mean by the first one "ignore any line length limitation and put them in a single line"?

Yes. (And likewise for the other possibilities, I mean "ignore any line length //capabilities// and put them all like this." My goal is to avoid the current state where my eyes are constantly having to scan back and forth to figure out "how is //this// function formatted?" — instead these functions should all just use the same formatting style, consistently.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116234



More information about the libcxx-commits mailing list