◐ Shell
clean mode source ↗

std::stack<T,Container>::operator= - cppreference.com

[edit template]

<tbody> </tbody>

stack& operator=( const stack& other );

(1)

stack& operator=( stack&& other );

(2) (C++11以上)

コンテナアダプタの内容を other の内容で置き換えます。

1) コピー代入演算子。 内容を other の内容のコピーで置き換えます。 実質的に c = other.c; を呼びます。 (暗黙に宣言)

2) ムーブ代入演算子。 ムーブセマンティクスを用いて内容を other の内容と置き換えます。 実質的に c = std::move(other.c); を呼びます。 (暗黙に宣言)

引数

other - ソースとして使用される別のコンテナアダプタ

戻り値

*this

計算量

ベースとなるコンテナの operator= の計算量と同じ。

関連項目

stack を構築します
(パブリックメンバ関数) [edit]