Skip to content

Commit 6fcf1e8

Browse files
committed
Span: Make type pointer and reference declaration consistent with guideline.
1 parent 9b9d33a commit 6fcf1e8

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

platform/Span.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct Span {
7676
* @post a call to size() will return array_size and data() will return
7777
* @p array_ptr.
7878
*/
79-
Span(T* array_ptr, size_t array_size) :
79+
Span(T *array_ptr, size_t array_size) :
8080
_array(array_ptr) {
8181
MBED_ASSERT(array_size >= (size_t) Size);
8282
}
@@ -123,7 +123,7 @@ struct Span {
123123
*
124124
* @pre index shall be less than size().
125125
*/
126-
T& operator[](size_t index)
126+
T &operator[](size_t index)
127127
{
128128
return _array[index];
129129
}
@@ -137,7 +137,7 @@ struct Span {
137137
*
138138
* @pre index shall be less than size().
139139
*/
140-
const T& operator[](size_t index) const
140+
const T &operator[](size_t index) const
141141
{
142142
return _array[index];
143143
}
@@ -147,7 +147,7 @@ struct Span {
147147
*
148148
* @return The raw pointer to the array.
149149
*/
150-
T* data()
150+
T *data()
151151
{
152152
return _array;
153153
}
@@ -157,7 +157,7 @@ struct Span {
157157
*
158158
* @return The raw pointer to the array.
159159
*/
160-
const T* data() const
160+
const T *data() const
161161
{
162162
return _array;
163163
}
@@ -213,7 +213,7 @@ struct Span {
213213
}
214214

215215
private:
216-
T* _array;
216+
T *_array;
217217
};
218218

219219
/**
@@ -238,7 +238,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
238238
* @post a call to size() will return array_size and data() will return
239239
* @p array_ptr.
240240
*/
241-
Span(T* array_ptr, size_t array_size) :
241+
Span(T *array_ptr, size_t array_size) :
242242
_array(array_ptr), _size(array_size) { }
243243

244244
/**
@@ -262,7 +262,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
262262
* @param other The Span object used to construct this.
263263
*/
264264
template<size_t Size>
265-
Span(const Span<T, Size>& other):
265+
Span(const Span<T, Size> &other):
266266
_array(other.data()), _size(other.size()) { }
267267

268268
/**
@@ -293,7 +293,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
293293
*
294294
* @pre index shall be less than size().
295295
*/
296-
T& operator[](size_t index)
296+
T &operator[](size_t index)
297297
{
298298
return _array[index];
299299
}
@@ -307,7 +307,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
307307
*
308308
* @pre index shall be less than size().
309309
*/
310-
const T& operator[](size_t index) const
310+
const T &operator[](size_t index) const
311311
{
312312
return _array[index];
313313
}
@@ -317,7 +317,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
317317
*
318318
* @return The raw pointer to the array.
319319
*/
320-
T* data()
320+
T *data()
321321
{
322322
return _array;
323323
}
@@ -327,7 +327,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
327327
*
328328
* @return The raw pointer to the array.
329329
*/
330-
const T* data() const
330+
const T *data() const
331331
{
332332
return _array;
333333
}
@@ -357,7 +357,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
357357
}
358358

359359
private:
360-
T* _array;
360+
T *_array;
361361
size_t _size;
362362
};
363363

@@ -371,7 +371,7 @@ struct Span<T, SPAN_DYNAMIC_EXTENT> {
371371
* and false otherwise.
372372
*/
373373
template<typename T, typename U, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
374-
bool operator==(const Span<T, LhsSize>& lhs, const Span<U, RhsSize>& rhs)
374+
bool operator==(const Span<T, LhsSize> &lhs, const Span<U, RhsSize> &rhs)
375375
{
376376
if (lhs.size() != rhs.size()) {
377377
return false;
@@ -394,7 +394,7 @@ bool operator==(const Span<T, LhsSize>& lhs, const Span<U, RhsSize>& rhs)
394394
* and false otherwise.
395395
*/
396396
template<typename T, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
397-
bool operator==(const Span<T, LhsSize>& lhs, T (&rhs)[RhsSize])
397+
bool operator==(const Span<T, LhsSize> &lhs, T (&rhs)[RhsSize])
398398
{
399399
return lhs == Span<T>(rhs);
400400
}
@@ -409,7 +409,7 @@ bool operator==(const Span<T, LhsSize>& lhs, T (&rhs)[RhsSize])
409409
* and false otherwise.
410410
*/
411411
template<typename T, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
412-
bool operator==(T (& lhs)[LhsSize], const Span<T, RhsSize>& rhs)
412+
bool operator==(T (&lhs)[LhsSize], const Span<T, RhsSize> &rhs)
413413
{
414414
return Span<T>(lhs) == rhs;
415415
}
@@ -424,7 +424,7 @@ bool operator==(T (& lhs)[LhsSize], const Span<T, RhsSize>& rhs)
424424
* content and false otherwise.
425425
*/
426426
template<typename T, typename U, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
427-
bool operator!=(const Span<T, LhsSize>& lhs, const Span<U, RhsSize>& rhs)
427+
bool operator!=(const Span<T, LhsSize> &lhs, const Span<U, RhsSize> &rhs)
428428
{
429429
return !(lhs == rhs);
430430
}
@@ -439,7 +439,7 @@ bool operator!=(const Span<T, LhsSize>& lhs, const Span<U, RhsSize>& rhs)
439439
* and false otherwise.
440440
*/
441441
template<typename T, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
442-
bool operator!=(const Span<T, LhsSize>& lhs, T (&rhs)[RhsSize])
442+
bool operator!=(const Span<T, LhsSize> &lhs, T (&rhs)[RhsSize])
443443
{
444444
return !(lhs == Span<T, RhsSize>(rhs));
445445
}
@@ -454,7 +454,7 @@ bool operator!=(const Span<T, LhsSize>& lhs, T (&rhs)[RhsSize])
454454
* and false otherwise.
455455
*/
456456
template<typename T, ptrdiff_t LhsSize, ptrdiff_t RhsSize>
457-
bool operator!=(T (& lhs)[LhsSize], const Span<T, RhsSize>& rhs)
457+
bool operator!=(T (&lhs)[LhsSize], const Span<T, RhsSize> &rhs)
458458
{
459459
return !(Span<T, LhsSize>(lhs) == rhs);
460460
}
@@ -492,7 +492,7 @@ Span<T, Size> make_Span(T (&elements)[Size])
492492
* created 'inline'.
493493
*/
494494
template<size_t Size, typename T>
495-
Span<T, Size> make_Span(T* elements)
495+
Span<T, Size> make_Span(T *elements)
496496
{
497497
return Span<T, Size>(elements, Size);
498498
}
@@ -511,7 +511,7 @@ Span<T, Size> make_Span(T* elements)
511511
* created 'inline'.
512512
*/
513513
template<typename T>
514-
Span<T> make_Span(T* array_ptr, size_t array_size)
514+
Span<T> make_Span(T *array_ptr, size_t array_size)
515515
{
516516
return Span<T>(array_ptr, array_size);
517517
}
@@ -548,7 +548,7 @@ Span<const T, Size> make_const_Span(const T (&elements)[Size])
548548
* created 'inline'.
549549
*/
550550
template<size_t Size, typename T>
551-
Span<const T, Size> make_const_Span(const T* elements)
551+
Span<const T, Size> make_const_Span(const T *elements)
552552
{
553553
return Span<const T, Size>(elements, Size);
554554
}
@@ -568,7 +568,7 @@ Span<const T, Size> make_const_Span(const T* elements)
568568
* created 'inline'.
569569
*/
570570
template<typename T>
571-
Span<const T> make_const_Span(T* array_ptr, size_t array_size)
571+
Span<const T> make_const_Span(T *array_ptr, size_t array_size)
572572
{
573573
return Span<const T>(array_ptr, array_size);
574574
}

0 commit comments

Comments
 (0)