Open BigUglySpider opened 2 years ago
This issue was raised when drafting plans for Matrix comparisons and deciding that this recursive approach would be far too difficult to parse for maintenance if implemented in a Matrix structure.
As matrices will, thus, be using a folded list of indices as per all other Matrix functions thus far, it is reasonable to request that this is done to maintain consistency throughout the library.
This is a non-breaking change, and must not modify any use of interfaces at a higher level of abstraction than EmuMath::Helpers::_vector_underlying
.
Fold expressions would be preferable as it would 1: clean up code, and 2: provide a much cleaner piece for the compiler to read and optimise, and likely reduce compile times (marginally) due to the removal of recursive template instantiations.
This could also produce some better short-circuit optimisations, although I am not too keenly aware of how these optimisations are delivered.
Nonetheless,
return (... && cmp_(_vector_get_theoretical<Indices_>(lhs_), _vector_get_theoretical<Indices_>(rhs_)));
, andreturn (... || cmp_(_vector_get_theoretical<Indices_>(lhs_), _vector_get_theoretical<Indices_>(rhs_)));
are significantly easier to parse and maintain compared to the current: