-
Notifications
You must be signed in to change notification settings - Fork 112
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
Why does numerator(const cpp_rational&)
not return a const& cpp_int
#377
Comments
Would it make sense to have a traits class which tells us that it is const& or a copy? |
Not really, as of current develop, none of the rational types store pairs of |
GMPXX's For A completely different strategy would be to have |
I'm leaning towards agreeing with you on this - but it will require a fair bit of refactoring - so please bare with me! |
Did this question get any further thought? Could that be an interesting Google Summer of Code topic co-mentored by the CGAL project and you @jzmaddock ? |
Sorry haven't had a chance yet, a joint SOC project isn't a bad idea, but for this change the student would need to spend a lot of time understanding our internals, for what is actually a relative small amount of coding. Question, do you guys need to be able to write:
If not, then expression templates would work and avoid the type-punning. However, given that the type punning issue only effects |
The referenced PR addresses this. Note that there are some rational types where numerator/denominator still return by value, this is to support for example |
I would expect not get a copy. Is the rational number more than just two integers?
The text was updated successfully, but these errors were encountered: