-
Notifications
You must be signed in to change notification settings - Fork 111
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
Use traits more lazily #98
Comments
#include <boost/multiprecision/gmp.hpp>
struct A{ virtual void g()=0; };
void f(A&);
void f(boost::multiprecision::mpq_rational);
void h(A&a){ f(a); } With g++ on linux, I get similar errors about The original error happens for |
Thanks for the test case - I'm testing a fix now, but there are still cases that will fail - for example if type A is incomplete - that particular case is probably unfixable though. |
Unless the type is a valid object we can't instantiate numeric_limits even to check is_specialized, in particular applies to abstract class types which implement the arithmetic operators as the multiprecision operators may get checked as well, which in tern tries to instantiate the number<> converting constructor which then checks numeric_limits. See #98.
Hello,
I am debugging some code through occasional testsuite results so this won't be super specific, sorry.
I notice a lot of eager use of traits (accessing
::value
) in Boost.Multiprecision. For instanceEven if the type is not convertible,
is_restricted_conversion
is still going to be instantiated. In my case, with some recent visual studio, a call to an overloaded function on something that is not a number type at all ends up with an error in numeric_limits (through is_restricted_conversion, etc) and not the SFINAE I would have expected.If you replace
T1::value&&!T2::value
withmpl::and_<T1,mpl::not_<T2>>::value
, I believe it might help (I can't easily check). It might also improve compilation time.I am just showing one place because this is what the error message points to, but the use of values instead of classes is everywhere in this library 😞 .
The text was updated successfully, but these errors were encountered: