view: protect functions taking indices with enable_if
This commit is contained in:
parent
4b3b001d18
commit
44760c6869
20
view.hpp
20
view.hpp
@ -276,7 +276,10 @@ namespace cruft {
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
template <typename IndexT>
|
template <
|
||||||
|
typename IndexT,
|
||||||
|
typename = std::enable_if_t<std::is_integral_v<IndexT>>
|
||||||
|
>
|
||||||
[[nodiscard]] constexpr auto
|
[[nodiscard]] constexpr auto
|
||||||
split (IndexT idx) const
|
split (IndexT idx) const
|
||||||
{
|
{
|
||||||
@ -306,7 +309,10 @@ namespace cruft {
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
template <typename IndexT>
|
template <
|
||||||
|
typename IndexT,
|
||||||
|
typename = std::enable_if_t<std::is_integral_v<IndexT>>
|
||||||
|
>
|
||||||
constexpr auto
|
constexpr auto
|
||||||
head (IndexT idx)
|
head (IndexT idx)
|
||||||
{
|
{
|
||||||
@ -315,7 +321,10 @@ namespace cruft {
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
template <typename IndexT>
|
template <
|
||||||
|
typename IndexT,
|
||||||
|
typename = std::enable_if_t<std::is_integral_v<IndexT>>
|
||||||
|
>
|
||||||
constexpr auto
|
constexpr auto
|
||||||
tail (IndexT idx)
|
tail (IndexT idx)
|
||||||
{
|
{
|
||||||
@ -324,7 +333,10 @@ namespace cruft {
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
template <typename IndexT>
|
template <
|
||||||
|
typename IndexT,
|
||||||
|
typename = std::enable_if_t<std::is_integral_v<IndexT>>
|
||||||
|
>
|
||||||
[[nodiscard]] constexpr auto
|
[[nodiscard]] constexpr auto
|
||||||
consume (IndexT count) const
|
consume (IndexT count) const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user