File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,27 @@ requires(!IsRvalueReference<T>) class Vector {
382382 MUST (try_empend (forward<Args>(args)...));
383383 }
384384
385+ template <class ... Args>
386+ ALWAYS_INLINE void unchecked_empend (Args&&... args)
387+ requires(!contains_reference)
388+ {
389+ VERIFY (m_size < capacity ());
390+ if constexpr (want_fast_last_access) {
391+ ++m_metadata.last_slot ;
392+ ++m_size;
393+ } else {
394+ ++m_size;
395+ }
396+
397+ StorageType* last_slot;
398+ if constexpr (want_fast_last_access)
399+ last_slot = m_metadata.last_slot ;
400+ else
401+ last_slot = slot (m_size - 1 );
402+
403+ new (last_slot) StorageType (forward<Args>(args)...);
404+ }
405+
385406 template <typename U = T>
386407 void prepend (U&& value)
387408 requires(CanBePlacedInsideVector<U>)
You can’t perform that action at this time.
0 commit comments