8000 Rename operator""_z to _uz per P0330R8, and move into namespace manifold by BenFrantzDale · Pull Request #869 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

BenFrantzDale
Copy link
Contributor

#868

I don't see a public_test.cpp anywhere. Is there somewhere I should put the test for this?

Copy link
google-cla bot commented Jul 18, 2024

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.

Copy link
codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 75.86207% with 7 lines in your changes missing coverage. Please review.

Project coverage is 90.07%. Comparing base (d437097) to head (fcb0a0b).
Report is 64 commits behind head on master.

Files Patch % Lines
src/manifold/src/boolean_result.cpp 0.00% 2 Missing ⚠️
src/utilities/include/public.h 0.00% 2 Missing ⚠️
src/manifold/src/impl.cpp 66.66% 1 Missing ⚠️
src/manifold/src/properties.cpp 75.00% 1 Missing ⚠️
src/utilities/include/sparse.h 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@pca006132
Copy link
Collaborator

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.

Copy link
Owner
@elalish elalish left a 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.

/**
* 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; }
Copy link
Owner

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!

Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Collaborator

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.

@BenFrantzDale BenFrantzDale force-pushed the change-to-operator_uz branch from 6cda3b9 to 9b24fa4 Compare July 18, 2024 20:10
@BenFrantzDale BenFrantzDale force-pushed the change-to-operator_uz branch from 9b24fa4 to fcb0a0b Compare July 18, 2024 20:19
@@ -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),
Copy link
Contributor Author

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.

Copy link
Owner

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

Comment on lines +601 to +607
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);
});
Copy link
Contributor Author

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);
        });

@elalish elalish merged commit ccb682f into elalish:master Jul 18, 2024
21 checks passed
@elalish elalish mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0