We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6dd5ea commit 95fc284Copy full SHA for 95fc284
platform/Span.h
@@ -183,6 +183,9 @@ struct Span {
183
*/
184
reference operator[](index_type index) const
185
{
186
+#ifdef MBED_DEBUG
187
+ MBED_ASSERT(0 <= index && index < Extent);
188
+#endif
189
return _data[index];
190
}
191
@@ -454,6 +457,9 @@ struct Span<ElementType, SPAN_DYNAMIC_EXTENT> {
454
457
455
458
456
459
460
461
+ MBED_ASSERT(0 <= index && index < _size);
462
463
464
465
0 commit comments