[PATCH] D100669: [ADT] Add llvm::remove_cvref and llvm::remove_cvref_t
Scott Linder via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 11:10:24 PDT 2021
scott.linder added inline comments.
================
Comment at: llvm/unittests/ADT/STLForwardCompatTest.cpp:48-52
+using STLForwardCompatRemoveCVRefTestTypes = ::testing::Types<
+ std::pair<int, int>, std::pair<int &, int>, std::pair<const int, int>,
+ std::pair<volatile int, int>, std::pair<const volatile int &, int>,
+ std::pair<int *, int *>, std::pair<int *const, int *>,
+ std::pair<const int *, const int *>, std::pair<int *&, int *>>;
----------------
dblaikie wrote:
> scott.linder wrote:
> > The formatting here gets a bit muddy, I considered adding a typedef of `std::pair` with a longer name, so that the formatting would refer one entry per line. Does that seem like it would be an improvement?
> I wouldn't change the type to force a different formatting - I think clang-format has some comment you can use to disable its formatting? Or you can add an empty comment to force a line break.
> ```
> using STLForwardCompatRemoveCVRefTestTypes = ::testing::Types<
> // clang-format off
> std::pair<int, int>,
> std::pair<int &, int>,
> std::pair<const int, int>,
> std::pair<volatile int, int>,
> std::pair<const volatile int &, int>,
> std::pair<int *, int *>,
> std::pair<int *const, int *>,
> std::pair<const int *, const int *>,
> std::pair<int *&, int *>
> // clang-format on
> >;
> ```
Ah, I wasn't aware that was possible, thank you!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100669/new/
https://reviews.llvm.org/D100669
More information about the llvm-commits
mailing list