You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
virtualvoidaddAtIndex(int index, T &&value) { addAtIndex(index, value); }
170
+
virtualvoidaddAtIndex(int index, T &&value) {
171
+
if (this->isMutable()) {
172
+
return;// Mutable lists cannot save rvalues!
173
+
}
174
+
addAtIndex(index, value);
175
+
}
151
176
#endif
152
177
153
178
/*!
154
179
* @brief Add all entries from the given list to this list at a specified
155
180
* index. The original entry at this index, and followings, will be placed
156
181
* directly after the entries of the given list.
157
182
* @note The elements from the other list, remain untouched.
183
+
* @note If the other list is mutable and the values saved in the lists are primitives, nothing happens.
158
184
*
159
185
* @param index Index of this list, at which all entries should be added.
160
186
* @param list Other list from where to copy the entries.
@@ -168,6 +194,7 @@ class AbstractList {
168
194
/*!
169
195
* @brief Add all entries from the given list at the end of the list.
170
196
* @note The elements from the other list, remain untouched.
197
+
* @note If the other list is mutable and the values saved in the lists are primitives, nothing happens.
171
198
*
172
199
* @param list Other list to copy from.
173
200
*/
@@ -178,6 +205,7 @@ class AbstractList {
178
205
* The original entry at this index, and followings, will be placed
179
206
* directly after the entries of the given list.
180
207
* @note The elements from the other list, remain untouched.
208
+
* @note If this list is mutable, ensure, that the other lists do not go out-of-scope during all operations of this list. If the other list is mutable, all values added to this lists are immutable.
181
209
*
182
210
* @param index Index of this list, at which all entries should be added.
183
211
* @param arr Array.
@@ -204,28 +232,32 @@ class AbstractList {
204
232
205
233
/*!
206
234
* @brief Add a new entry at the beginning of the list.
207
-
*
235
+
* @note If this list is mutable, ensure, that all variables added to the lists do not go out-of-scope during all operations of the list.
0 commit comments