Skip to content
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

Make float128 a trivially copyable type #636

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

nmnobre
Copy link
Contributor

@nmnobre nmnobre commented Aug 2, 2024

Closes #635.

Opted to go for trivially copyable and not fully trivial as otherwise we'd have to make the constexpr float128_backend() noexcept constructor trivial but I expect we'd like to keep zero initialisation for the data member m_value we're wrapping even when using default initialisation. In any case, I never needed the type to be trivial, only trivially copyable, so I'm happy if you are?

Code snippet to print type traits and limits: https://godbolt.org/z/ddsj16M7W. I'm not sure we need everything in there, I just copied the original snippet and added a trivially copyable check, but feel free to edit it to your liking and we can then amend the website. :)

@nmnobre nmnobre changed the title Making float128 a trivially copyable type Make float128 a trivially copyable type Aug 2, 2024
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (0f6a276) to head (320d8b7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #636     +/-   ##
=========================================
- Coverage     94.1%   94.1%   -0.0%     
=========================================
  Files          276     276             
  Lines        26846   26839      -7     
=========================================
- Hits         25240   25232      -8     
- Misses        1606    1607      +1     
Files Coverage Δ
include/boost/multiprecision/number.hpp 96.5% <100.0%> (-<0.1%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f6a276...320d8b7. Read the comment docs.

@nmnobre nmnobre marked this pull request as ready for review August 2, 2024 16:22
@mborland mborland merged commit 320d8b7 into boostorg:develop Aug 6, 2024
78 checks passed
@mborland
Copy link
Member

mborland commented Aug 6, 2024

Thanks for this. I also added a trivial test: c2b11c1, and update the code snippet from your original question: b16cff2

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.

Is boost::multiprecision::float128 a trivial type?
2 participants