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
|
||||
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
|
||||
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
|
||||
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
|
||||
consume (IndexT count) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user