名稱空間
變體
操作

std::stack<T,Container>::operator=

來自 cppreference.com
< cpp‎ | 容器‎ |
stack& operator=( const stack& other );
(1) (隱式宣告)
stack& operator=( stack&& other );
(2) (C++11 起)
(隱式宣告)

用給定引數的內容替換容器介面卡的內容。

1) 複製賦值運算子。用 `other` 的內容的副本替換當前內容。實際上是呼叫 `c = other.c;`。
2) 移動賦值運算子。使用移動語義,用 `other` 的內容替換當前內容。實際上是呼叫 `c = std::move(other.c);`。

目錄

[編輯] 引數

其他 - 另一個用作源的容器介面卡

[編輯] 返回值

*this

[編輯] 複雜度

1,2) 等同於底層容器的 operator= 的複雜度。

[編輯] 示例

[編輯] 參閱

構造 `stack`
(public member function) [edit]