Same as #28657, but without the refactoring required to work around fixed MSVC bugs.
The second commit has been taken from #29167.
operator""_mst
consteval
(re-take)
#32564
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32564.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | hodlinator, sipa |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
134
135 public:
136- //! Construction function used by the ""_mst operator.
137- static consteval Type Make(uint32_t flags) noexcept { return Type(flags); }
138+ //! The only way to publicly construct a Type is using this literal operator.
139+ friend constexpr Type operator""_mst(const char* c, size_t l);
nits in bc4fb79a4e2ce90f1340328cae033e008227c166: Applied a revert of 63317103c9f2b0635558da814567bb79c17ae851 to the PR base (ff1ee102c4babadd85e4a18234061f10daaa119d) and noticed it brought back the space before the literal name:
0friend constexpr Type operator"" _mst(const char* c, size_t l);
The space was removed in faf21625652fd0d4bbf9b86fd9ebedb5857505ea, so I guess you manually edited the revert to account for that? Might want to mention it in the commit message.
You missed preserving the added newline in the definition from faf21625652fd0d4bbf9b86fd9ebedb5857505ea:
0inline constexpr Type operator""_mst(const char* c, size_t l)
1{
153@@ -154,12 +154,11 @@ class Type {
154 };
155
156 //! Literal operator to construct Type objects.
157-inline consteval Type operator""_mst(const char* c, size_t l)
158-{
159- Type typ{Type::Make(0)};
160+inline consteval Type operator""_mst(const char* c, size_t l) {
consteval
/constexpr
implies inline
AFAIK. Understand if you don’t want to diverge more from the commits you revert/apply in this PR though.
ACK b1f7877bb79f72d212d0ad6907ec1057f96693a7
Cleans up workarounds made for older MSVC versions.
Mainly code review, but also tried applying the revert on top of PR base myself and found some nits.
This reverts commit 63317103c9f2b0635558da814567bb79c17ae851.
operator""_mst has been manually adjusted according to commit
faf21625652fd0d4bbf9b86fd9ebedb5857505ea
Thank you for the review. Your feedback has been addressed.