coord: add product function
This commit is contained in:
parent
1678cb3a69
commit
e0f0e3b19b
@ -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) \
|
||||
template < \
|
||||
|
Loading…
Reference in New Issue
Block a user