Open Cazadorro opened 1 year ago
Thanks for reporting! Right now, I literally have no time to work on units (both the mainline and the V2 branch). I will try to look into this issue soon.
It seems like that the msvc compiler is not able to check that ::fmt::detail::do_throw(x)
in fmt_hacks.h always throws.
The example compiles when the function call is replaced by throw x
. No idea what is the best way to fix this.
I am sorry that it takes so long to address this issue. We will not fix the old version, and unfortunately, MSVC still crashes in multiple places on the V2 implementation, so we can't check and fix that for you. We made some good progress with those crashes on the last CppCon, though, so hopefully, we will enable MSVC compilation soon.
@mpusz we're fine upgrading to the latest version so no need to patch old versions.
Given the very basic example, compilation fails, and it fails when using fmt::format. for example, everything is fine, up until line 57:
std::cout << UNITS_STD_FMT::format("{}", v3) << '\n';
where I get:
If I look at the relevant portion of code causing the error, I indeed see this:
which if the errors are correct, mean that it 100% makes sense why there would be errors here, there's floats and chars being put into this thing with no return path at compile time.
It looks like there's some sort of issue with some sort of
std::variant
based on the monostate present? But it's not letting me see exactly where the issue is (looks like there's some sort of monkey patching going on, making it impossible for me to diagnose on my own).