Along the way I have also corrected tygrab in similar way. There it seems that N (the index, first template argument) would be better std::ptrdiff_t type. However that would result in mixing signed and unsigned types in same expression. While there is no real benefit as we will never use negative index anyway.
I also wonder why tygrap uses the ternary expression to make upper bound of the index. It seems static_assert would be better. Or is there a use case for such behaviour? Anyway it seems a separate topic so I didn't do anything about that.
Changes for #2.
Along the way I have also corrected
tygrab
in similar way. There it seems thatN
(the index, first template argument) would be betterstd::ptrdiff_t
type. However that would result in mixing signed and unsigned types in same expression. While there is no real benefit as we will never use negative index anyway.I also wonder why
tygrap
uses the ternary expression to make upper bound of the index. It seemsstatic_assert
would be better. Or is there a use case for such behaviour? Anyway it seems a separate topic so I didn't do anything about that.