Details
- Reviewers
• Quuxplusone ldionne Mordante var-const - Group Reviewers
Restricted Project - Commits
- rGc77de9490ead: [libc++][NFC] Reformat and modernize compressed_pair.h
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
LGTM, I looked at everything and this is indeed NFC. I don't understand why this is failing in C++03 mode, either.
Ship it but please consider my comments.
libcxx/include/__memory/compressed_pair.h | ||
---|---|---|
68 | Suggestion: move the explicit to the next line, otherwise it's really easy to miss. | |
119 | It's more customary to leave the attributes on the line above, like so: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 typename _Base1::reference first() _NOEXCEPT { ... } Otherwise, it's difficult to parse the function declaration itself because it's too obscured by these annotations. I think it's fine to leave the constructors above like _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __compressed_pair_elem() = default; as-is since it allows aligning them and their body is empty anyway, so that's more readable. |
- Address comments
libcxx/include/__memory/compressed_pair.h | ||
---|---|---|
33 | I re-formatted manually. |
Looks acceptable to me; I'm not sure it buys us anything, but it looks harmless.
libcxx/include/__memory/compressed_pair.h | ||
---|---|---|
68 | +1, explicit should come on the same line (and immediately preceding) the ctor's name. | |
94–95 | If Clang is happy with this, probable yikes. git grep tells me that the majority position is pre-=: using _Base1 _LIBCPP_NODEBUG = __compressed_pair_elem<_T1, 0>; and I'd be worried that post-= meant something different to the compiler. | |
108 | FWIW, I'd prefer to leave this : ... on the next line, for clarity and to match line 115 below. |
- Address comments
libcxx/include/__memory/compressed_pair.h | ||
---|---|---|
68 | I want this to stay NFC, so I won't add explicit here. |
Same on line 31.
Just curious did you reformat manually or using clang-format?