Closed MangelSpec closed 1 year ago
prevent issues with floating point type conversations since min doesn't return the actual minimum possible number. as an example where this caused issues:
void variant_test(std::variant<float, bool> test) { printf("variant_test: "); if(std::holds_alternative<float>(test)) { printf("float: %f\n", std::get<float>(test)); } else if (std::holds_alternative<bool>(test)) { printf("bool: %d\n", std::get<bool>(test)); } }
registering this function to javascript and calling it with (0) as argument will give the error "Unable to convert argument to variant."
Hi @MangelSpec
good catch, thanks a lot!
I've rebased your PR and fixed test case in #191, so I close this one.
prevent issues with floating point type conversations since min doesn't return the actual minimum possible number. as an example where this caused issues:
registering this function to javascript and calling it with (0) as argument will give the error "Unable to convert argument to variant."