| 292 | } |
| 293 | |
| 294 | bool insert(iterator pos, const T &value) FL_NOEXCEPT { |
| 295 | if (current_size >= N) { |
| 296 | return false; |
| 297 | } |
| 298 | |
| 299 | // Construct a new element at end() position using placement new |
| 300 | new (end()) T(); |
| 301 | ++current_size; |
| 302 | |
| 303 | // Shift elements from [pos, end-1) to the right by one position |
| 304 | for (iterator p = end() - 1; p > pos; --p) { |
| 305 | *p = fl::move(*(p - 1)); |
| 306 | } |
| 307 | |
| 308 | // Assign the new value to the insertion position |
| 309 | *pos = value; |
| 310 | return true; |
| 311 | } |
| 312 | |
| 313 | // Move version of insert |
| 314 | bool insert(iterator pos, T &&value) FL_NOEXCEPT { |