Obsolete Members for QVarLengthArray

以下成員源於類 QVarLengthArray 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(deprecated (6.3)) void prepend (T && value )
(deprecated (6.3)) void prepend (const T & value )

成員函數文檔編製

void QVarLengthArray:: prepend ( T && value )

void QVarLengthArray:: prepend (const T & value )

This function is deprecated since 6.3. We strongly advise against using it in new code.

This is slow. If you must, use insert(cbegin(), ~~~) 代替。

插入 value at the beginning of the array.

This is the same as vector.insert(0, value ).

For large arrays, this operation can be slow ( 綫性時間 ), because it requires moving all the items in the vector by one position further in memory. If you want a container class that provides a fast prepend () function, use std::list instead.

另請參閱 append () 和 insert ().