mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2026-01-04 17:21:04 +07:00
two-type dot and cross functions
This commit is contained in:
@@ -305,10 +305,11 @@ namespace vmath_hpp
|
||||
|
||||
namespace vmath_hpp
|
||||
{
|
||||
template < typename T >
|
||||
[[nodiscard]] std::enable_if_t<std::is_arithmetic_v<T>, T>
|
||||
constexpr dot(T x, T y) noexcept {
|
||||
return x * y;
|
||||
template < typename T, typename U
|
||||
, typename V = decltype(std::declval<T>() * std::declval<U>()) >
|
||||
[[nodiscard]] std::enable_if_t<std::is_arithmetic_v<V>, V>
|
||||
constexpr dot(T x, U y) noexcept {
|
||||
return { x * y };
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
|
||||
Reference in New Issue
Block a user