coord: add product function

This commit is contained in:
Danny Robson 2018-04-17 17:01:53 +10:00
parent 1678cb3a69
commit e0f0e3b19b

View File

@ -1098,6 +1098,21 @@ namespace util {
} }
//-------------------------------------------------------------------------
template <
typename K,
typename = std::enable_if_t<is_coord_v<K>>
>
auto
product (K const& k)
{
typename K::value_type accum = 1;
for (auto i: k)
accum *= i;
return accum;
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define VECTOR_OP(OP) \ #define VECTOR_OP(OP) \
template < \ template < \