4 ms·
Small annoyance (I haven't read the entire thing, but I have strong feelings about this): gsl::index is disgustingly verbose. If you use stl, just use size_t. I
by Matheus28 9y ago
Small annoyance (I haven't read the entire thing, but I have strong feelings about this): gsl::index is disgustingly verbose. If you use stl, just use size_t. If you're using something else, follow the conventions they use (be it size_t, int, or whatever). Their examples [1] conveniently omit size_t to push their alternative.
[1] https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-subscripts https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
- Leszek 9y agoI think you're missing the point that gsl::index, unlike size_t, is signed.
- AstralStorm 9y agoSsize_t then. Or ptrdiff_t.
- smitherfield 9y ago`ssize_t` isn't standard C++ (it is required by POSIX); `ptrdiff_t` is only one character fewer than `gsl::index`.