-
Notifications
You must be signed in to change notification settings - Fork 129
Rename operator""_z to _uz per P0330R8, and move into namespace manifold #869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #869 +/- ##
==========================================
- Coverage 91.84% 90.07% -1.77%
==========================================
Files 37 65 +28
Lines 4976 9156 +4180
Branches 0 950 +950
==========================================
+ Hits 4570 8247 +3677
- Misses 406 909 +503 ☔ View full report in Codecov by Sentry. |
Thanks! If it builds, it is fine, we do not have specific tests about this. I think you need to format the code using clang-format as well as agree to the CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, both for noticing and quickly fixing! Signing the individual CLA should be a one-click automatic thing. Once those last two checks turn green we'll merge this.
src/utilities/include/public.h
Outdated
/** | ||
* Stand-in for C++23's operator""uz (P0330R8)[https://wg21.link/P0330R8]. | ||
*/ | ||
[[nodiscard]] constexpr std::size_t operator""_uz(unsigned long long n) noexcept { return n; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused me to look up [[nodiscard]]
- that's a nice language feature, and one we should probably use more. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm in the habit of being very pedantic about that and using it nearly everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvements like that are always welcome, if you're in the mood to improve our API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to know that this is available with c++17. Thought these attributes are for c++20.
6cda3b9
to
9b24fa4
Compare
9b24fa4
to
fcb0a0b
Compare
@@ -255,7 +255,7 @@ void AddNewEdgeVerts( | |||
[&](size_t hash) { mutexes[hash % mutexes.size()].unlock(); }, | |||
std::placeholders::_1); | |||
tbb::parallel_for( | |||
tbb::blocked_range<size_t>(0_z, p1q2.size(), 32), | |||
tbb::blocked_range<size_t>(0_uz, p1q2.size(), 32), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, tbb::blocked_range
will inver its type, so tbb::blocked_range(0_uz, p1q2.size(), 32),
should work just as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good fodder for a follow-on
tbb::parallel_for( | ||
tbb::blocked_range<size_t>( | ||
0_uz, static_cast<size_t>(std::distance(first, last))), | ||
[&](const tbb::blocked_range<size_t> &range) { | ||
std::transform(first + range.begin(), first + range.end(), | ||
d_first + range.begin(), f); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this can be
tbb::parallel_for(
tbb::blocked_range(first, last),
[&](const auto& range) {
std::transform(range.begin(), range.end(),
d_first + std::distance(first, range.begin()), f);
});
#868
I don't see a
public_test.cpp
anywhere. Is there somewhere I should put the test for this?