On Thu, Jul 3, 2014 at 2:55 PM, Fabien Picarougne < fabien.picarougne@univ-nantes.fr> wrote:
Thank you for your very interesting remarks. I did not know the QVM library and I have spent a little time to understand it. Initially, Traits was in my future plans, but the work that has been done on QVM is more developed that what was in my mind. But, in my understanding, there are some differences in our two approaches. I understand the intent of QVM and I agree with that. In my case, the main objective was to factor methods (to avoid writing the same thing twice)
Yes, avoiding writing the same code twice is the main objective of any library. :) My point is that I've seen this kind of code rewritten not twice but many times over, which indicates that there are competing incompatible design goals at play. So, the idea behind QVM is not to provide the "best" implementation, but to serve as a default set of operations that "just work", so the user doesn't have to implement all of them for each vector or matrix type they use... I think there is another difference in the design of both library in the
usage of specialization. In what I understand, QVM uses enable_if pattern to achieve this specialization, and I use template specialization.
...yet any function (template) overload defined for a given user-defined class (template) will be preferred by the overload resolution process over any enable_if overload defined by the QVM library. So the user reserves the right to take control if needed. As well, many QVM operations emit different vector and matrix types for which the full set of operations is automatically available. This is a key feature that enables any object's type to be reinterpreted by the type system without creating temporaries (e.g. you could access a row or a column of a matrix as a vector, or view a vector as a translation matrix, etc.) -- Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode