Closed nmnobre closed 1 month ago
on my machine,
std::is_trivial<float128>::value
isfalse
?
And I believe on every other machine. This is a software type with a wrapper and it is not trivial.
I hope I got that right, as @jzmaddock can correct me if I'm wrong.
Agreed. But the output I quoted clearly states std::is_trivial<> = true
?
boost::multiprecision::float128
should be a trivial type since it's just a wrapper over __float128
, but godbolt confirms for a range of library versions and compilers it is not: https://godbolt.org/z/PPxa5K5nP. Since it shows type name of float128_t
in the above snip that may be from __float128
rather than boost::multiprecision::float128
.
That's exactly my experience as well, thus why I asked for the actual code. :)
That's exactly my experience as well, thus why I asked for the actual code. :)
I doubt the code still exists since it's not in the repo. The comment in question was added here: https://github.com/boostorg/multiprecision/commit/0fe173730d5e74a376a9e1f080e3a0d801e7bd11, but unfortunately the author of that commit passed a few years ago. I tried Godbolt with the configuration specified in the comment, and it did not show boost::multiprecision::float128
as trivial then either: https://godbolt.org/z/qddTnq8qz
Oh, I just noticed is_fundamental
is also marked true
... I think you might be right, that output isn't representative of boost's wrapper.
The copy constructor here is non-trivial, so I think that's the end of that:
I think that output came from something else entirely - we should remove or update it.
I can't help wondering if we could make the type trivial though, it probably should be.
Hi,
Could you please post the code you used to generate the following?
https://github.com/boostorg/multiprecision/blob/0f6a276756e2fb3b9226000a3b24f788787e2474/example/float128_snips.cpp#L50-L90
For some reason, on my machine,
std::is_trivial<float128>::value
isfalse
?Thank you, Nuno