File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ struct Segment
65
65
// / @brief Appends a Span to the end of the segment
66
66
[[nodiscard]] bool append (Span<const T> span);
67
67
68
+ // / @brief Appends a Span of items convertible to T to the end of the segment
69
+ template <typename U>
70
+ [[nodiscard]] bool append (Span<const U> span);
71
+
68
72
// / @brief Moves contents of another segment to the end of this segment
69
73
[[nodiscard]] bool appendMove (Segment&& other);
70
74
Original file line number Diff line number Diff line change @@ -224,6 +224,18 @@ bool SC::Segment<VTable>::append(Span<const T> span)
224
224
return false ;
225
225
}
226
226
227
+ template <typename VTable>
228
+ template <typename U>
229
+ [[nodiscard]] bool SC::Segment<VTable>::append(Span<const U> span)
230
+ {
231
+ for (const U& it : span)
232
+ {
233
+ if (not push_back (it))
234
+ return false ;
235
+ }
236
+ return true ;
237
+ }
238
+
227
239
template <typename VTable>
228
240
bool SC::Segment<VTable>::appendMove(Segment&& other)
229
241
{
You can’t perform that action at this time.
0 commit comments