cmp should not use deduce_scalar. cmp should use the function object of an argument directly.
Document of cmp says...
Similar to operator==, except that the individual elements of a and b are passed
but it use deduce_scalar and convert values.
The document of deduce_scalar says...
This template is used by generic binary operations that return a scalar, to deduce the return type based on the (possibly different) scalars of their arguments.
I think cmp does not need deduce_scalar because it does not return a scalar.
I used cmp with vec<double, 3> and vec<unsigned long long, 3> and it cause unexpected error below.
no type named type in boost::qvm::deduce_scalar_detail::deduce_scalar_impl<double, unsigned long long>typedef typename deduce_scalar_detail::deduce_scalar_impl<A,B>::type type;
Also cmp uses row array of scalar type of arguments a and b. It will not work if scalar types of that are not default constructible. And it uses assign to row array but it will not work if user does not include row array adaption. It is not desirable for the library itself to include it, as the user may wish not to adapt.
cmp
should not usededuce_scalar
.cmp
should use the function object of an argument directly.Document of
cmp
says...but it use
deduce_scalar
and convert values.The document of
deduce_scalar
says...I think
cmp
does not needdeduce_scalar
because it does not return a scalar.I used
cmp
withvec<double, 3>
andvec<unsigned long long, 3>
and it cause unexpected error below.Also
cmp
uses row array of scalar type of argumentsa
andb
. It will not work if scalar types of that are not default constructible. And it usesassign
to row array but it will not work if user does not include row array adaption. It is not desirable for the library itself to include it, as the user may wish not to adapt.