coord/ops: add lshift
This commit is contained in:
parent
b01173d82b
commit
3e5c89f643
@ -1426,7 +1426,23 @@ namespace util {
|
||||
{
|
||||
return rshift (k, num, K {fill});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <
|
||||
typename K,
|
||||
typename = std::enable_if_t<
|
||||
is_coord_v<K>
|
||||
>
|
||||
>
|
||||
constexpr auto
|
||||
lshift (const K k, const int places, typename K::value_type fill)
|
||||
{
|
||||
K res {};
|
||||
std::copy_n (std::cbegin (k) + places, K::elements - places, std::begin (res));
|
||||
std::fill_n (std::begin (res) + K::elements - places, places, fill);
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user