boostorg / multiprecision

Boost.Multiprecision
Boost Software License 1.0
195 stars 111 forks source link

Mac M3. boost 1.86.0 Boost.Multiprecision compile error #638

Open guangbinl opened 4 weeks ago

guangbinl commented 4 weeks ago

I use the boost header library in an Unreal Engine 5.4 C++ project on a Mac M3 computer, and a syntax error is prompted during the compilation process. How can I solve this problem? The error content is as follows:

0>is_backend.hpp(39,40): Error : statement expression not allowed at file scope 0> static constexpr bool value = sizeof(check(get())) == sizeof(double); 0> ^ 0>is_backend.hpp(39,26): Error : constexpr variable 'value' must be initialized by a constant expression 0> static constexpr bool value = sizeof(check(get())) == sizeof(double);

mborland commented 4 weeks ago

Do you have a minimal reproducer for how you encountered this error? Which language standard were you using?

ckormanyos commented 4 weeks ago

a syntax error is prompted during the compilation process.

minimal reproducer for how you encountered this error?

Indeed. We need the use-case. Most of Multiprecision is not constexpr and not (yet, mabe later) intended to be. So we need to see exactly what is being queried at compile-time to judge if it should or should not be constexpr.

jzmaddock commented 3 weeks ago

In addition to the comments above, I have a hunch that this is the sort of error you might see from certain "vintage" compilers: so it would be good to know which compiler this is and the version.