Namespaces
Variants

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

From cppreference.net

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
(公开成员函数)