Skip to content

Commit 7f195b8

Browse files
committed
Span: Cleanup usage of ptrdiff_t and size_t
1 parent d8c788a commit 7f195b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platform/Span.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct Span {
181181
*
182182
* @return A new Span over the first @p Count elements.
183183
*/
184-
template<std::size_t Count>
184+
template<std::ptrdiff_t Count>
185185
Span<T, Count> first() const {
186186
MBED_ASSERT(Count <= Size);
187187
return Span<T, Count>(_array);
@@ -194,7 +194,7 @@ struct Span {
194194
*
195195
* @return A new Span over the last @p count elements.
196196
*/
197-
Span<T> last(std::ptrdiff_t count) const {
197+
Span<T> last(std::size_t count) const {
198198
MBED_ASSERT(count <= Size);
199199
return Span<T>(_array + (Size - count), count);
200200
}
@@ -339,7 +339,7 @@ struct Span<T, SPAN_DYNAMIC_SIZE> {
339339
*
340340
* @return A new Span over the first @p count elements.
341341
*/
342-
Span<T> first(std::ptrdiff_t count) const {
342+
Span<T> first(std::size_t count) const {
343343
MBED_ASSERT(count <= _size);
344344
return Span<T>(_array, count);
345345
}
@@ -351,7 +351,7 @@ struct Span<T, SPAN_DYNAMIC_SIZE> {
351351
*
352352
* @return A new Span over the last @p count elements.
353353
*/
354-
Span<T> last(std::ptrdiff_t count) const {
354+
Span<T> last(std::size_t count) const {
355355
MBED_ASSERT(count <= _size);
356356
return Span<T>(_array + (_size - count), count);
357357
}

0 commit comments

Comments
 (0)