-
Notifications
You must be signed in to change notification settings - Fork 119
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
armadillo / bandicoot conv_to ambiguity #320
Comments
Dealing with ADL is always fun. Not sure what the best approach is without looking into this deeper. However, the suggested approach (essentially an abstraction layer) sounds pragmatic and doable. (PS. Based on experience, ADL in its current state is a net negative in my view. In retrospect, its inclusion into the C++ standard was a mistake. A better solution would be to have an explicit |
I guess another solution would be to make |
Armadillo aims to follow both the letter and spirit of Matlab syntax, where stand-alone functions take inputs and provide outputs, ie. There are targeted exceptions for pragmatic reasons, such as For the |
Thanks for the clarification; I also don't want to backport specific armadillo functions because we like to support older versions. That said, I think the extra type-dependent conversion utility is good enough. |
The workaround solution you proposed is a bit tedious, but unfortunately I don't think we can do much better than that. 👍 |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍 |
In some optimizers / functions we use
conv_to<type>::from(X)
, now ADL doesn't work here since it matchesarma::conv_to
andcoot::conv_to
, so this will fail if I build against bandicoot. An easy solution is to introduce atype_trait
forcoot
andarma
types and implement a utility function that call's the rightconv_to
based on the type. But maybe there is a better solution? @conradsnicta @rcurtinThe text was updated successfully, but these errors were encountered: