Skip to content

Commit c956a93

Browse files
committed
Span: Improve subspan return type.
This clarifies code and documentation generated.
1 parent 03d308d commit c956a93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/Span.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,15 +697,15 @@ struct Span<ElementType, SPAN_DYNAMIC_EXTENT> {
697697
* @return A subspan of this starting at Offset and Count long.
698698
*/
699699
template<std::ptrdiff_t Offset, std::ptrdiff_t Count>
700-
Span<element_type, Count == SPAN_DYNAMIC_EXTENT ? SPAN_DYNAMIC_EXTENT : Count>
700+
Span<element_type, Count>
701701
subspan() const
702702
{
703703
MBED_ASSERT(0 <= Offset && Offset <= _size);
704704
MBED_ASSERT(
705705
(Count == SPAN_DYNAMIC_EXTENT) ||
706706
(0 <= Count && (Count + Offset) <= _size)
707707
);
708-
return Span<element_type, Count == SPAN_DYNAMIC_EXTENT ? SPAN_DYNAMIC_EXTENT : Count>(
708+
return Span<element_type, Count>(
709709
_data + Offset,
710710
Count == SPAN_DYNAMIC_EXTENT ? _size - Offset : Count
711711
);

0 commit comments

Comments
 (0)